Linux/Unix simple shortcut summary

  
        Ctrl + a switch to the command line start
This operation is the same as the Home implementation, but Home can not be used in some Unix environments, you can use this combination; in Linux, vim, this is also valid; This is also valid in many file editors in Windows.
Ctrl + e Switch to the end of the command line
This operation is the same as the END implementation, but the End key can not be used in some Unix environments, you can use this combination; in Linux, vim, this is also Effective; in addition, this is also valid in many file editors in Windows.
Ctrl + l Clear the screen content, the effect is equivalent to clear
Ctrl + u Clear the content before the cut cursor
This command is very useful, it is also valid in nslookup. I sometimes see a colleague deleting a shell command with one word and one word, which is very crashing! In fact, it can be done with a Ctrl + u.
Ctrl + k Cut and clear the content after the cursor
Ctrl + y Paste the character just deleted
This command is more powerful, the deleted character may be several strings, but it is most likely a line command.
Ctrl + r Find in the history command (this is very easy to use, input the keyword to call out the previous command)
I strongly recommend this command, sometimes history is more, I want to find a more complicated, direct Here, the shell will automatically find and call, very convenient
Ctrl + c terminate the command
Ctrl + d exit the shell, logout
Ctrl + z turn into the background to run
However, by Ctrl + z The process running into the background will terminate after the current user exits, so it is better to use the nohup command & because the nohup command is used after the user exits, and now many scripts and commands are required to exit at root. It is still valid.
The following is not too familiar, we use more operations:
!! Repeat the last command
history Show all the number + history commands you have executed. This can be combined with! Edit to execute a certain command
↑(Ctrl+p) Display the previous command
↓(Ctrl+n) Display the next command
!$ Display the most recent parameter of the system< Br> Finally, this is useful, for example, I use cat /etc/sysconfig/network-scripts/ifconfig-eth0 first, then I want to edit with vim. The general practice is to use ↑ to display the last command, then use Home to move to the front of the command, delete cat, and then enter the vim command. In fact, you can use vim !$ instead.
Development and administrators, after mastering the above usage, basically the work is very efficient; in the end, you will inadvertently find out that there are many complicated instructions between the fingers, you will be very easy to get.

Copyright © Windows knowledge All Rights Reserved