Ubuntu Terminal Hotkeys Cheat Sheet
Cursor Movement
| Shortcut | Action |
|---|---|
Ctrl + A | Move to the beginning of the line |
Ctrl + E | Move to the end of the line |
Ctrl + B | Move back one character |
Ctrl + F | Move forward one character |
Alt + B | Move back one word |
Alt + F | Move forward one word |
Editing & Deletion
| Shortcut | Action |
|---|---|
Ctrl + U | Delete from the cursor to the beginning of the line |
Ctrl + K | Delete from the cursor to the end of the line |
Ctrl + W | Delete the word before the cursor |
Alt + D | Delete the word after the cursor |
Ctrl + H | Delete the character before the cursor (Backspace) |
Ctrl + D | Delete the character under the cursor; if the line is empty, send EOF (usually exits the shell) |
Ctrl + Y | Paste (yank) the last deleted text |
Command History
| Shortcut | Action |
|---|---|
Ctrl + R | Search command history |
Ctrl + G | Cancel history search |
Ctrl + P | Previous command (same as ↑) |
Ctrl + N | Next command (same as ↓) |
!! | Repeat the previous command |
Process Control
| Shortcut | Action |
|---|---|
Ctrl + C | Interrupt the running command |
Ctrl + Z | Suspend the running command (fg to resume in foreground, bg to resume in background) |
Screen
| Shortcut | Action |
|---|---|
Ctrl + L | Clear the screen (same as clear) |
Ctrl + S | Pause terminal output |
Ctrl + Q | Resume terminal output |
Clipboard (Ubuntu Terminal)
| Shortcut | Action |
|---|---|
Ctrl + Shift + C | Copy selected text |
Ctrl + Shift + V | Paste from the system clipboard |
Most Useful Command-Line Tricks
| Shortcut | Action |
|---|---|
Tab | Auto-complete commands, paths, and filenames |
Tab ×2 | Show all completion candidates |
↑ / ↓ | Browse command history |