Linux Terminal Shortcuts

Shortcut helps us to be more efficient and productive with whatever tool we use. The terminal isn't an exception. In Linux, there are several shortcuts of the terminal that all users should practice and know.

Linux operating system is very flexible that we often can get the similar output in many different ways. The command-line and terminal evidently play an important role for almost all Linux users.

Significantly, shortcuts can improve our skills and save our time. These shortcuts are a combination of keys or simply keys that give quick access to a particular command or task. Almost everyone applies shortcut keys for their convenience.

These shortcut keys will help us to performing certain tasks like running and accessing previously run commands, changing/deleting/editing text on the terminal, opening the editor, controlling processes, moving the cursor, etc on the terminal.

Must familiar Linux Shortcuts

We would like to specify that a few of the shortcuts might depend on the Shell we are using. However, Bash is one of the most famous shells. Hence, the list is concentrated on Bash. If we want, we may also pronounce it Bash shortcut list.

Note: We have used some capital letters in the shortcuts of the keyboard. But, it doesn't mean that we have to hold the shift button while implementing these shortcuts.

1. Tab

It is a Linux shortcut we can't live without. This shortcut will save so much time inside the Linux terminal.

Just begin entering a command, filename, command options, or directory name and enter the tab key. Either it will complete automatically what we were entering or it will display every possible output for us.

This shortcut would be the perfect one if we could only remember a single shortcut.

2. Ctrl+C

These are some of the keys we should click for breaking out of a process or command on the command line. It will immediately stop an executing program.

If we wish to stop using any program executing inside the foreground, we need to just click the combination of these keys.

3. Ctrl+Z

It will transfer an executing program inside the background. We can normally achieve it before executing the program with the help of an option, i.e., "&". However, if we didn't remember to do that, we can also use this combination of keys.

4. Ctrl+D

These shortcut keys will log us out of the terminal (current). It would be closed if we are using the SSH connection. The application would be immediately closed if we are directly using the terminal.

Assume it as the "exit" command in Linux.

5. Ctrl+L

How do we clear our terminal screen?

Rather than using C-L-E-A-R, we can simply write Ctrl+L shortcut keys for clearing the terminal.

6. Ctrl+A

It will move the mouse cursor to the starting of the line. Assume we wrote a long path or command and we wish to go to the starting of it, it will take time if doing it with the arrow keys for moving the cursor.

Note: In the Linux terminal, we can't use the mouse to the strains of the line.

It is where Ctrl+A will save our day.

7. Ctrl+E

It is quite the same as the Ctrl+A shortcut option. Ctrl+A transfers the cursor to the starting of the line while Ctrl+E will move the cursor of the mouse to the completion of the line.

Note: When we have the End and Home keys on our keyboard, we can use them as well. The End key of similar to the Ctrl+E shortcut keys and the Home key is similar to the Ctrl+A shortcut keys.

8. Ctrl+U

Rather than using a backspace for discarding the current command, we can use the Ctrl+U shortcut keys within the Linux terminal. It will erase everything from the recent cursor location to the starting of the line.

Ctrl+K

It is the same as Ctrl+U. A single difference between these shortcuts is that rather than starting of the line, it will erase everything from the recent cursor location to the completion of the line.

9. Ctrl+W

We just understood about removing text till the starting and the completion of the line. What if we just require to erase one world? Use the Ctrl+W combination of the keys. We can remove the word preceding to a cursor position with the help of the Ctrl+W keys.

The cursor will remove every letter from the position of the cursor to the starting of the line if it is on the word itself. The best form to use it for moving the cursor to the upcoming space after the spotted word and use Ctrl+W keys.

10. Ctrl+Y

These keys are used for pasting the erased text that we saw using Ctrl+K, Ctrl+U, and Ctrl+W shortcuts keys. It is efficient in case we erased text or when we have to use that erased text again.

Ctrl+N

We can use these shortcut keys in conjugation with the Ctrl+P keys. The Ctrl+N keys show the upcoming command. If we are viewing the previous commands using Ctrl+P, we can use the Ctrl+N keys for navigating back and forth. Several terminals include these shortcut

keys mapped to PgDn keys.

Ctrl+P

We can use these shortcut keys for viewing the previous commands. Repeatedly, we can click them for keeping on going back within the history of the command. In several terminals, the similar could be achieved by PgUp key.

Ctrl+R

These shortcut keys permit us to implement a search in our command history. We need to just click the Ctrl+R keys that matches the string we entered.

Note: The entered string can be anywhere within the command.

If we wish to see other commands for the similar string, we need to just keep clicking the Ctrl+R keys.

We can hit Enter button to execute the command selected or hit Esc button for coming out of the search along with the last search output.

Ctrl+Shift+N

These shortcut keys are used for opening a new terminal window. We should already be over the terminal window for this to operate.

Ctrl+Shift+T

If we use the above combination of the keys, we can open the terminal tab over the similar window.

Ctrl+Shift+C

These keys are used for copying the chosen content.

Ctrl+Shift+V

These keys are used for pasting the content copied within the clipboard.

Atl+F

These keys are used for moving a single word forward. We can use Ctrl+right arrow key alternatively to do so.

Alt+B

These keys are used for moving a single word backward. We can use Ctrl+left arrow key alternatively to do so.

Ctrl+PgDn

We can use the above combination of keys for moving to the right tab.

Ctrl+PgUp

We can similarly use the above combination of keys for moving to the left tab.

Ctrl+Shift+PgUp

We can use these shortcut keys for moving the tab (current) to right.

Ctrl+Shift+PgUp

We can use these shortcut keys for moving the tab (current) to left.

Shift+PgDn/PgUp

We can use the above shortcut keys for scrolling up or scrolling down by the console.

Arrow Up/Down

We can use these up or down arrow shortcut keys for going from the previously run commands.

Ctrl+Alt+T= Open Terminal

Ctrl+J= Enter

Ctrl+Shift+Q

It will close each tab on the terminal window (current). But, it will not implement in case of open terminal window.

Ctrl+Alt+D

The combination of the above keys will minimise every Windows/terminals and show our desktop. We can repeat it for reverting our widows back in the similar order.

Ctrl+O

It will transfer the command back to our terminal or choose Enter to run the command through the search mode.

Ctrl+G

It will leave the search mode of the history without executing a command.