🖥️ Terminal / CLI Shortcuts
Speed up your command-line workflow with essential terminal and shell shortcuts.
🔍
Navigation
| 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 |
Editing
| 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) |
History
| 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 |
Process Control
| 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) |
What Is This?
- Reference for terminal and CLI keyboard shortcuts
- Covers Bash/Zsh line editing and history navigation
- Includes tmux and screen session shortcuts
- Essential shortcuts for job control and navigation
- Boost command-line speed and efficiency
How to Use
- Browse terminal shortcuts by category
- Search for specific actions or key combinations
- Review shortcuts for your specific shell — Bash, Zsh
- Practice in your terminal to build muscle memory
- Reference tmux and screen shortcuts for session management
Use Cases
- Speeding up command-line editing and navigation
- Navigating command history more efficiently
- Managing terminal sessions with tmux and screen
- Learning CLI shortcuts as a new developer
- Reducing typing with line editing shortcuts