Commands Shortcut
Advanced Keyboard Tricks
Ctrl + A— Move cursor to the beginning of the lineCtrl + E— Move cursor to the end of the lineCtrl + F— Move forward one characterCtrl + B— Move backward one characterAlt + F— Move forward one wordAlt + B— Move backward one wordCtrl + L— Clear the screen
Text Editing Commands
Ctrl + D— Delete the character just after the cursorCtrl + T— Swap (transpose) the character just before and after the cursorAlt + T— Swap the word at the cursor location with the preceding wordAlt + L— Convert the character from the current position to the end of the word to lowercaseAlt + U— Same asAlt + L, but converts to UPPERCASE
Cut and Paste (Kill and Yank) Commands
In Linux and Unix-like systems, instead of traditional cut and paste, we often refer to:
- Killing (cutting text),
- Yanking (pasting text),
- And the Kill Ring, which is a buffer storing killed (cut) text.
Kill Commands
Ctrl + K— Kill text from the cursor location to the end of the lineCtrl + U— Kill text from the cursor location to the beginning of the lineAlt + D— Kill text from the cursor to the end of the current wordAlt + Backspace— Kill text from the cursor to the beginning of the current word- If the cursor is at the beginning of a word, it kills the previous word
Yank (Paste) Command
Ctrl + Y— Yank (paste) the last killed text from the kill ring and insert it at the cursor location
Command Line History
-
history— Show the list of previously executed commands -
history -c— Clear the command history -
history— Show the list of previously executed commands -
history -c— Clear the command history