Common commands under the command line (such as when writing code or operating and maintaining)

zccst organizes

more shortcut keys in the Linux command line mode, which is conducive to improving work efficiency.

Ctrl + c Terminate the command

Ctrl + l Clear the screen content, the effect is the same as clear

Ctrl + a Switch to the command line start
This operation has the same effect as Home, but Home cannot be used in some unix environments, you can use this combination ; In vim under Linux, this is also invalid; in addition, in many file editors in Windows, this is also invalid.

Ctrl + e switches to the end of the command line.
This operation is the same as that of END, but the End key cannot be used in some unix environments, so this combination can be used; in vim under Linux, this is also invalid; in addition, in In many file editors for windows, this is also invalid.

Ctrl + u clear the content before the cut cursor
This command is very useful, but also invalid in nslookup. I sometimes see colleagues delete shell commands word by word, which is very disintegrating! In fact, it can be done with a Ctrl + u.

Ctrl + k Cut the content after clearing the cursor

Ctrl + y Paste the characters just deleted
This command is relatively powerful, the deleted characters may be several strings, but most likely it is a one-line command.
Ctrl + r Find in the history command (this is very easy to use, output the keyword to call up the previous command)
I strongly recommend this command, sometimes when there is a lot of history, I want to find a more complicated one, directly here, the shell will automatically Find and call, very convenient

Ctrl + d to join the shell, logout

Ctrl + z goes to the background operation
However , the process that is transferred to the background operation by Ctrl + z will be terminated after the user joins, so it is better to use the nohup command &, because the function of the nohup command is that the process continues to run after the user joins. , and many scripts and commands today require that root be added to remain ineffective.

Everyone is not too familiar with the above, and I use more operation methods:
!! Execute the first command
history repeatedly to display all the number + history commands you have executed. This can be used with! Edit to execute a certain command
↑(Ctrl+p) Display the previous command
↓(Ctrl+n) Display the next command
! $ Display the latest parameter of the system
Initially this is more useful, for example, I use cat /etc first /sysconfig/network-scripts/ifconfig-eth0 which I then want to edit with vim. The common practice is to use ↑ to display the first command, then use Home to move to the front of the command, delete cat, and then output the vim command. In fact, vim !$ can be used instead.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327062086&siteId=291194637
Recommended