Keyboard Shortcuts
Speed up your terminal workflow with essential shortcuts
These shortcuts work in most terminals on all operating systems. They’ll save you enormous amounts of time.
The Essential Five
Learn these first — they're the ones you'll use every day
| Shortcut | What it does | When to use it |
|---|---|---|
| Tab | Auto-complete file/folder names | After typing the first few letters of a name |
| Up Arrow | Previous command from history | When you want to repeat or modify a recent command |
| Ctrl + C | Cancel/stop current process | When something is stuck or you want to abort |
| Ctrl + L | Clear the screen | When your terminal feels cluttered |
| Ctrl + D | Exit the terminal / end input | When you’re done or want to close a session |
Instead of typing cd my-really-long-project-name, type cd my and press Tab. If there’s only one match, it completes instantly. If there are multiple matches, press Tab twice to see all options. This works for commands, file names, and folder names.
Navigation Within a Line
Moving your cursor around the current command
| Shortcut | What it does |
|---|---|
| Ctrl + A | Jump to beginning of line |
| Ctrl + E | Jump to end of line |
| Ctrl + W | Delete word before cursor |
| Ctrl + U | Delete from cursor to beginning of line |
| Ctrl + K | Delete from cursor to end of line |
| Ctrl + Y | Paste what you just deleted (yank) |
| Alt + B | Jump back one word |
| Alt + F | Jump forward one word |
History
Navigating and searching your command history
| Shortcut | What it does |
|---|---|
| Up / Down arrows | Scroll through previous commands |
| Ctrl + R | Search command history (start typing to filter) |
| !! | Repeat the last command |
| !$ | Use the last argument from the previous command |
history | Show full command history |
history | grep keyword | Search history for a specific command |
Press Ctrl+R, then start typing part of a command you used before. The terminal will search your history and show the most recent match. Press Ctrl+R again to cycle through older matches. Press Enter to run it, or Esc to cancel. This is one of the biggest time-savers once you get used to it.
Process Control
Managing running commands
| Shortcut | What it does |
|---|---|
| Ctrl + C | Kill the current process |
| Ctrl + Z | Suspend the current process (pause it) |
fg | Resume a suspended process in foreground |
bg | Resume a suspended process in background |
| Ctrl + D | Send EOF (end of file) — closes the terminal |
Useful Operators
Combining and redirecting commands
| Operator | What it does | Example |
|---|---|---|
&& | Run next command only if first succeeds | mkdir app && cd app |
|| | Run next command only if first fails | test -f file || echo "not found" |
> | Redirect output to file (overwrite) | echo "hello" > file.txt |
>> | Redirect output to file (append) | echo "more" >> file.txt |
| | Pipe output of one command to another | ls | grep ".txt" |
Building muscle memory
You don’t need to memorize all of these at once. Here’s a learning sequence:
- Week 1: Tab, Up Arrow, Ctrl+C — these three alone transform your experience
- Week 2: Add Ctrl+L, Ctrl+A, Ctrl+E
- Week 3: Add Ctrl+R for history search
- Beyond: The rest will come naturally as you work
The goal isn’t to memorize a table — it’s to reach for these shortcuts instinctively. That only happens through practice.