Speed up your command-line workflow with essential terminal and shell shortcuts.
| Shortcut | Action |
|---|---|
| ⌃ + A | Move to start of line |
| ⌃ + E | Move to end of line |
| ⌥ + B | Move back one word |
| ⌥ + F | Move forward one word |
| ⌃ + B | Move back one char |
| ⌃ + F | Move forward one char |
| ⌃ + XX | Toggle between start and cursor |
| ⌃ + P | Previous command (same as ↑) |
| ⌃ + N | Next command (same as ↓) |
| ⌥ + Left click | Move cursor to click position |
| Home | Move to start of line |
| End | Move to end of line |
| Shortcut | Action |
|---|---|
| ⌃ + U | Cut from cursor to start |
| ⌃ + K | Cut from cursor to end |
| ⌃ + W | Cut word before cursor |
| ⌥ + D | Cut word after cursor |
| ⌃ + Y | Paste last cut text |
| ⌃ + T | Swap current and previous char |
| ⌥ + T | Swap current and previous word |
| ⌃ + _ | Undo last edit |
| ⌃ + H | Delete char before cursor (backspace) |
| ⌃ + D | Delete char under cursor (or exit shell) |
| ⌥ + Delete | Delete word before cursor |
| ⌃ + L | Clear screen (keep current line) |
| Shortcut | Action |
|---|---|
| ⌃ + R | Search command history |
| ⌃ + P | Previous command (same as ↑) |
| ⌃ + N | Next command (same as ↓) |
| ⌃ + G | Cancel history search |
| !! | Repeat last command |
| !$ | Last argument of previous cmd |
| !abc | Run last command starting with abc |
| ⌃ + R | Reverse search history |
| ⌃ + G | Cancel reverse search |
| ⌃ + O | Execute found command |
| !! | Repeat last command |
| !$ | Last argument of previous command |
| !* | All arguments of previous command |
| !abc | Run last command starting with "abc" |
| history | Show command history |
| Shortcut | Action |
|---|---|
| ⌃ + C | Kill current process |
| ⌃ + Z | Suspend current process |
| ⌃ + D | Exit / EOF |
| ⌃ + L | Clear screen |
| ⌃ + S | Stop output to terminal |
| ⌃ + Q | Resume output to terminal |
| ⌃ + S | Pause output (freeze terminal) |
| ⌃ + Q | Resume output (unfreeze) |