🖥️ Terminal / CLI Shortcuts
Speed up your command-line workflow with essential terminal and shell shortcuts.
🔍
Bash / Zsh line-editing keys. On a Mac, ⌥ shortcuts need “Use Option as Meta key” (Terminal → Settings → Profiles → Keyboard) or “Esc+” for Left Option in iTerm2. On Windows they work in Windows Terminal, Git Bash and WSL.
39 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 character |
| ⌃+F | Move forward one character |
| ⌃+Xthen⌃+X | Toggle between start of line and cursor |
| ⌥+Click | Move cursor to the clicked position (Terminal.app, iTerm2) |
| Home | Move to start of line |
| End | Move to end of line |
Editing
| Shortcut | Action |
|---|---|
| ⌃+U | Cut from cursor to start of line |
| ⌃+K | Cut from cursor to end of line |
| ⌃+W | Cut word before cursor |
| ⌥+D | Cut word after cursor |
| ⌃+Y | Paste last cut text |
| ⌃+T | Swap current and previous character |
| ⌥+T | Swap current and previous word |
| ⌃+_ | Undo last edit |
| ⌃+H | Delete character before cursor (backspace) |
| ⌃+D | Delete character under cursor |
| ⌥+Delete | Delete word before cursor |
History
| Shortcut | Action |
|---|---|
| ↑ | Previous command |
| ↓ | Next command |
| ⌃+P | Previous command (same as ↑) |
| ⌃+N | Next command (same as ↓) |
| ⌃+R | Reverse search command history |
| ⌃+G | Cancel history search |
| ⌃+O | Run found command and fetch the next one |
| !! | 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 | Interrupt (stop) the current process |
| ⌃+Z | Suspend current process (resume with fg) |
| ⌃+D | Exit shell / send EOF (on an empty line) |
| ⌃+L | Clear screen (keep current line) |
| ⌃+S | Pause output (freeze terminal) |
| ⌃+Q | Resume output (unfreeze) |
No shortcuts match that search.
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