Shortcuts help you be more productive and efficient with any tool you use. Just think about it. If someone keeps the mouse down to copy all the text instead of Ctrl + A, how would you feel about it?
The Linux terminal Shortcuts is no exception. There are certain shortcuts of Linux terminals that every user must know and practice.
Trust me; Once you master these shortcuts, you will notice how good it is with the use of the Linux command line.
Linux Terminal Shortcuts
I want to mention that some of these shortcuts may depend on the Shell you are using. Bash is the popular Shell, so the list focuses on Bash. If you wish, you can also call it Bash Shortcut List.
Note that I used the uppercase letters in keyboard shortcuts, but this does NOT mean that I have to press the Shift key while using these shortcuts.
This is the Linux shortcut you can’t live without. It will save you a lot of time on the Linux command line.
Start typing a command, file name, directory name, or even command options and press the tab key. It will automatically complete what you were writing or show all possible results for you.
If I could only remember one shortcut, this would be the one.
Ctrl + D
This keyboard shortcut will disconnect you from the current terminal. If you are using a terminal directly, the application will close immediately.
Consider it equivalent to the “exit” command.
Ctrl + C
These are the keys that you must press to exit command or process in a terminal. This will stop a running program immediately.
If you want to stop using a program that runs in the foreground, simply press this key combination.
Ctrl + Z
This shortcut key will send a running program in the background. Usually, you can achieve this before running the program using the & option, but if you forgot to do so, use this key combination.
Ctrl + L
How do you clear the screen of your terminal? I guess using the clear command.
Instead of typing clear, you can use Ctrl + L to delete the terminal. Practical, right?
Ctrl + A
This shortcut key will move the cursor to the beginning of the line.
Suppose you wrote a command or long route in the terminal and you want to go to the beginning, using the arrow key to move the cursor will take a long time. Note that you cannot use the mouse to move the cursor to the beginning of the line.
This is where Ctrl + A saves the day.
Ctrl + U
Did you type an incorrect command? Instead of using the backspace key to discard the current command, use the Ctrl + U shortcut on the Linux terminal. This shortcut deletes everything, from the current cursor position to the beginning of the line.
Ctrl + E
This shortcut is something opposite to Ctrl + A. Ctrl + A sends the cursor to the beginning of the line, while Ctrl + E moves the cursor to the End of the line.
Note: If you have the Start and End keys on your keyboard, you can also use them. The start is equivalent to Ctrl + A, and End is equal to Ctrl + E.
Ctrl + W
You just learned to erase text until the beginning and end of the line. But what if you only need to delete a single word? Use the shortcut Ctrl + W.
Using the shortcut Ctrl + W, you can delete the word that precedes the cursor position. If the cursor is on word, it will erase all the letters from the cursor position to the beginning of the word.
The best way to use it to move the cursor to the next space after the target word and then use the keyboard shortcut Ctrl + W.
Ctrl + K
This command is similar to the Ctrl + U shortcut. The only difference is that, instead of the beginning of the line, it deletes everything from the current cursor position to the end of the line.
Ctrl + N
You can use this shortcut in conjunction with Ctrl + P. Ctrl + N shows the following command. If you view previous commands with Ctrl + P, you can use Ctrl + N to navigate from side to side. Many terminals have this shortcut assigned to the PgDn key.
Ctrl + P
You can use this shortcut to see the previous command. You can press it repeatedly to continue going backward in the command history. In many terminals, the same can be achieved with the PgUp key.
Ctrl + Y
This will paste the deleted text you saw with the shortcuts Ctrl + W, Ctrl + U, and Ctrl + K. It is useful in case you have deleted the wrong text or if you need to use the deleted text elsewhere.
Ctrl + R
Its keyboard shortcut allows you to perform a search in your command history. Press Ctrl + R and type andy command. It will show the last previous command that matches the string you wrote.
If you want to see more commands for the same string, simply press Ctrl + R.
You can press enter to execute the selected command or press Esc to exit the search with the last search result.
So this is a quick tutorial for Linux Terminal Shortcuts Keys. Thanks for reading and share your thoughts and comments with us in the section below.