Ctrl + C
: Terminate the commandCtrl + Z
: Suspend the commandCtrl + A
: Move to the start of the lineCtrl + E
: Move to the end of the lineCtrl + F
: Move forward one characterCtrl + B
: Move backward one characterCtrl + U
: Delete from the cursor to the start of the lineCtrl + K
: Delete from the cursor to the end of the lineCtrl + W
: Delete from the cursor to the start of the wordCtrl + D
: Delete the character under the cursorCtrl + H
: Delete the character before the cursorCtrl + T
: Swap the character under the cursor with the previous oneCtrl + L
: Clear the screen
Editing Shortcuts
Action | Bash Shortcuts |
---|
Tab | Ctrl + I |
New Line | Ctrl + J |
Enter | Ctrl + M |
Paste the Last Thing to be Cut | Ctrl + Y |
Undo | Ctrl + _ |
Upper the case Every Character Form Cursor | Alt + U |
Lower the case Every Character Form Cursor | Alt + L |
Capitalize the Character Under Cursor and Move to the End of the Word | Alt + C |
Cancel Changes and Put Back the Line | Alt + R |
Delete Character Under Cursor | Ctrl + D |
Delete Character From Left | Ctrl + H |
Delete Word before Cursor | Alt + Delete |
Delete Word after Cursor | Alt + D |
Clear Screen | Ctrl + L |
Escape | Ctrl + [ |
Cut Word Before Cursor to Clipboard | Ctrl + W |
Cut Line After Cursor to Clipboard | Ctrl + K |
Cut Line Before Cursor to Clipboard | Ctrl + U |
Swap Current Word with Previous | Alt + T |
Swap the Last Character before Cursor | Ctrl + T |
Swap the Last Two Words Before the Cursor | Esc + T |
Read More: 20 Zendesk Shortcuts You Should Know
Emacs and Vi Mode Shortcuts
Action | Bash Shortcut keys |
---|
Set Emacs Mode | $set -o emacs |
Set Vi Mode | $set -o vi |
Navigation Shortcuts
Action | Bash Shortcuts |
---|
Go to the Beginning of the Line | Home |
Go to the End of the Line | End |
Forward one character | Ctrl + F |
Backward one character | Ctrl + B |
Previous Command | Ctrl + P |
Next Command | Ctrl + N |
Back one word | Alt + B |
Forward one word | Alt + F |
Read More: 170 MS Access Shortcut Keys for Windows
Control Character Shortcuts
Action | Bash Shortcuts |
---|
^@ | Ctrl + 2 |
^Escape | Ctrl + 3 |
^\ | Ctrl + 4 |
^ | Ctrl + 5 |
^^ | Ctrl + 6 |
^_Undo | Ctrl + 7 |
^? Backward Delete Character | Ctrl + 8 |
Display Sequence for entering Key | Ctrl + V |
History Shortcuts
Action | Bash Shortcuts |
---|
Recall Last Command | Ctrl + R |
Previous Command in History | Ctrl + P |
Next Command in History | Ctrl + N |
Go back to Next Most Recent Command | Ctrl + S |
Escape from History Searching Mode | Ctrl + O |
Repeat Last Command | Ctrl + G |
Run Last Command Starting with ABC | !! |
Print the last Command starting with ABC | !abc |
Last Argument of Previous Command | !abc:p |
Last Argument of Previous Command | !$ |
All Arguments of Previous Command | Alt + . |
Run Previous Command, replacing abc with def | ^abc^def |
Read More: 10 Pandora Shortcuts You Should Know
Process Controls Shortcuts
Action | Bash Shortcuts |
---|
Recall Last Command | Ctrl + R |
Interrupt or Kill Whatever you are running | Ctrl + C |
Clear Screen | Ctrl + L |
Stop Output to Screen | Ctrl + S |
Allow Output to Screen | Ctrl + Q |
Send an EOF Marker | Ctrl + D |
Send the signal SIGTSTP to Current Task | Ctrl + Z |
The bash shortcuts will boost maximizing your productivity to around 90%. However, Bash is not the only shell out there. The one that can be the best alternative to bash is ZSH. It is a default shell in macOS. No doubt the experience of using this shell can be quite different. Dig into the ZSH shortcuts list.
https://tutorialtactic.com/keyboard-shortcuts/bash-shortcuts/
https://github.com/fliptheweb/bash-shortcuts-cheat-sheet