Handy shortcuts of Linux Bash terminal
, on Linux
I have been using Linux operating system since the year 2008. And while working on any Unix-like systems, our main interface as developers is to use the terminal, and most probably bash
environment.
To get our most of the work done, inside the terminal, we need arrow keys. But life shouldn’t be lived in that lame way. There are better shortcuts available at your disposal, those allow you to work with words in a single shot, instead of manipulating the characters in the terminal one-by-one.
Here are some of the shortcuts you may find useful:
Keyboard shortcut | Description of the shortcut |
---|---|
Ctrl+B | Moves the cursor left |
Ctrl+F | Moves the cursor right |
Ctrl+P | View the previous command (Moves the cursor up) |
Ctrl+N | View the next command (Moves the cursor down) |
Ctrl+A | Moves the cursor to the beginning of the line |
Ctrl+E | Moves the cursor to the end of the line |
Ctrl+W | Erases the preceding word |
Ctrl+U | Erases the cursor to the beginning of the line |
Ctrl+K | Erases from the cursor to the end of the line |
Ctrl+Y | Pastes erased text (i.e., from Ctrl+U) |
Alt+Backspace | Deletes one word at a time |
Ctrl+Left Arrow | Moves one word left at a time |
Ctrl+Right Arrow | Moves one word right at a time |
These few shortcut keys are really helpful in doing everyday work on the prompt without leaving your keyboard, and saving you some milliseconds. One plus point is, these shortcuts work without any problem, even if you are inside MySQL or Node.js prompt.
Let’s see, how much you gain from these shortcuts.
Thanks for reading till here. See you next time.