Linux commands believe that everyone can, especially some basic commands, such as ls, CD, cat, vi and so on.

After working with Linux for a long time, you’ll find that the same commands come and go.

Commands are not enough, but Linux provides some shortcuts that can quickly improve Linux efficiency.

1, the tap

File and path completion.

The TAB key is a commonly used shortcut key to complete the file name or path.

Just type a command, file name, directory name or even the beginning of the command option, and hit TAB. It will either automatically complete what you type or show you all the possible results.

2, Ctrl + l

Black screen.

Before I knew this shortcut, I guess everyone used the clear command to clear the screen.

You can now clear the terminal using Ctrl+L instead of typing clear

3. Ctrl + C

Terminate the process.

Key to press to interrupt a command or process on a terminal. It will immediately terminate the running program.

If you are installing, compiling, or running a program, Ctrl + C will immediately terminate your program.

4, Ctrl + Z

Puts running programs in the background.

Ctrl+ C will end the process, but if you don’t want to wait for the process to finish, you can use Ctrl+Z, which will send the process to the background.

Ctrl+A/Ctrl+E

Move the cursor to the beginning/end of the line.

Suppose you enter a long command or path at the terminal, such as:

[root@VM-8-8-centos ~]# netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
Copy the code

But if you want to go back to the beginning or end of it, using the arrow keys to move the cursor will take A lot of time, Ctrl+A, Ctrl+E will come in handy.

Note: Linux terminals do not support using the mouse to move the cursor to the beginning of a line.

6, erasure

Sometimes, when a wrong command is entered on the terminal, but you do not want to delete the whole command or only want to delete part of the command, erasing is convenient.

Ctrl + U

Erases everything from the current cursor position to the beginning of the line.

Ctrl + K

Erases everything from the current cursor position to the end of the line.

Ctrl + W

Erases all letters from cursor position to the beginning of the word.

It simply means erasing a word. Linux judges a word by a space.

Ctrl + Y

Paste text erased using Ctrl+W, Ctrl+U, and Ctrl+K shortcuts.

7. History commands

Ctrl + P, arrow keys

History command flip up.

Ctrl + N and press the Arrow key

History command to turn over.

Ctrl + R

Call history command.

8. Copy and paste

Linux does not use Ctrl+ C, Ctrl+ V copy and paste, Linux uses:

Copy: CTRL + insert

Paste: shift + insert

Currently, most terminal tools are automatically copied when selected, and automatically pasted after right mouse click, such as MobaXterm and SecurityCRT are supported.


Currently I use MobaXterm, MobaXterm is to support automatic copy, right click automatic paste, and free!

Amway Wave: a good terminal tool – MobaXterm