60 Bash Keyboard Shortcuts
Software engineers and avid Bash enthusiasts must prioritize mastering the shell. Mastering Bash shortcuts can streamline processes and eliminate the need for tedious manual steps.
Download Bash Keyboard Shortcuts PDF
Table of Contents
The Bash shell offers a wide range of shortcuts that are applicable across different operating systems. However, it’s important to note that some shortcuts may not function when accessing Bash remotely. Download the comprehensive list of Bash shortcuts in PDF format to enhance your proficiency.
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 From the 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 the Cursor | Ctrl + T |
Swap the Last Two Words Before the Cursor | Esc + T |
Similar Programs: IPython Shell Keyboard Shortcuts
Emacs and Vi Mode Shortcuts
Action | Bash Shortcut keys |
---|---|
Set Emacs Mode | $set -o emacs |
Set Vi Mode | $set -o vi |
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 |
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 the 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 |
Process Controls Shortcuts
Action | Bash Shortcuts |
---|---|
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 the Current Task | Ctrl + Z |
Bash shortcuts can significantly enhance productivity, improving efficiency by up to 90%. However, Bash is not the only shell available. An excellent alternative to Bash is ZSH, which is the default shell in macOS. While the experience of using this shell may differ, it’s worth exploring.
READ NEXT: