Shell Completions Reference
OtherQuick-reference table of keyboard shortcuts and autocomplete triggers for bash, zsh, and fish shells.
Tab Completion Basics
| Feature | bash | zsh | fish |
|---|---|---|---|
| File / directory completion | Tab | Tab | Tab |
| Command completion | Tab | Tab | Tab |
| Cycle through matches | Tab (twice) | Tab repeatedly | Tab repeatedly |
| List all matches | Tab (twice) | Tab (once) | Tab (once) |
| Variable completion ($VAR) | Tab | Tab | Tab |
| Username completion (~user) | Tab | Tab | Tab |
| Hostname completion (@host) | Tab | Tab | Tab |
| Command options (--flag) | Tab (after -) | Tab | Tab |
History Search & Navigation
| Action | bash | zsh | fish |
|---|---|---|---|
| Reverse history search | Ctrl+R | Ctrl+R | Ctrl+R |
| Forward history search | Ctrl+S | Ctrl+S | Ctrl+S |
| Previous command | ↑ / Ctrl+P | ↑ / Ctrl+P | ↑ / Ctrl+P |
| Next command | ↓ / Ctrl+N | ↓ / Ctrl+N | ↓ / Ctrl+N |
| Beginning of line | Ctrl+A | Ctrl+A | Ctrl+A |
| End of line | Ctrl+E | Ctrl+E | Ctrl+E |
Kill / Yank (Cut / Paste)
| Action | bash | zsh | fish |
|---|---|---|---|
| Cut from cursor to end | Ctrl+K | Ctrl+K | Ctrl+K |
| Cut from cursor to start | Ctrl+U | Ctrl+U | Ctrl+U |
| Cut word backwards | Ctrl+W | Ctrl+W | Ctrl+W |
| Cut word forwards | Alt+D | Alt+D | Alt+D |
| Paste last cut text | Ctrl+Y | Ctrl+Y | Ctrl+Y |
| Transpose characters | Ctrl+T | Ctrl+T | Ctrl+T |
Directory Navigation
| Action | bash | zsh | fish |
|---|---|---|---|
| Go to home directory | cd (alone) / cd ~ | cd (alone) / cd ~ | cd (alone) / cd ~ |
| Go to previous directory | cd - | cd - | cd - |
| Directory stack | pushd / popd / dirs | pushd / popd / dirs | pushd / popd / dirs |
| Autocd (type dir name) | shopt -s autocd | setopt autocd | Built-in |
| Fuzzy dir matching | — | Tab (with completion) | Tab |
Process Management
| Action | bash | zsh | fish |
|---|---|---|---|
| Interrupt (SIGINT) | Ctrl+C | Ctrl+C | Ctrl+C |
| Suspend (SIGTSTP) | Ctrl+Z | Ctrl+Z | Ctrl+Z |
| End of file (EOF) | Ctrl+D | Ctrl+D | Ctrl+D |
| Clear screen | Ctrl+L | Ctrl+L | Ctrl+L |
| Jobs list | jobs | jobs | jobs |
| Foreground job | fg | fg | fg |
| Background job | bg | bg | bg |
How to Use
1
Browse the tables
Scroll through the reference tables for bash, zsh, and fish shell shortcuts.
2
Find your shell
Locate the column for your preferred shell (bash, zsh, or fish).
3
Learn and apply
Use the shortcuts in your terminal to improve productivity.