Software engineers, and avid fans of Bash, must give utmost importance to mastering the shell. And the mastering of shells can take place with the help of Bash Shortcuts. Mastering the Bash shortcuts will prevent you from following the boring manual steps.
Download Bash Keyboard Shortcuts PDF
Table of Contents
The bash shell features a wide variety of Bash shortcuts you can use. The below list of Bash shortcuts will operate or work on any operating system. However, note that some of the bash shortcuts might not work if you are assessing bash remotely. Download the rich array of Bash Shortcuts list in the form of a PDF.
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 |
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 |
---|---|
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.
FAQs
Here are some commonly asked questions about Bash keyboard shortcuts:
What is the shortcut to exit the Bash terminal?
Typing the “exit” command or pressing Ctrl + D will exit the Bash terminal.
Are there any shortcuts to search through command history in Bash?
Ctrl + R is the shortcut to search through command history in Bash.
- Alt + B moves the cursor one word backward.
- Alt + F moves the cursor one word forward.
What is the shortcut to clear the screen in Bash?
Ctrl + L is the shortcut to clear the screen in Bash.
READ NEXT: