1. CTRL + W Delete the last word
2. CTRL + u delete a row
3. CD-Return to the last working directory
4. Cd ~ Return to the Home Directory
5 .! $
! $ Is a special environment variable, which represents the last string of the previous command.
Example:
Mkdir mydir
Mvmydir yourdir
CD yourdir
It is equivalent:
Mkdir mydir
MV! $ Yourdir
CD! $
6. sudo !!
Run the previous command as root.
Example:
For example, if we use apt-Get In ubuntu to install the software package as root, we may often forget to add sudo before apt-Get. Every time you have to add sudo and re-type this line of command, you can easily use sudo !! Done.
Note:
In Shell, sometimes a long command is entered, which can be used! Xxx to repeat the latest command. For example, if you have input Vim/home/Jibo/tiger before, you can use it directly next time! Vim repeats the last recent Vim command.
7. CD-
Return to the last directory.
For example, if the current directory is/home/a, use CD ../B to switch to/home/B. In this case, you can execute the CD-command repeatedly to switch back and forth between/home/a and/home/B.
8. 'alt +. "And <ESC> + ."
You can repeat the parameters of the last command line.
9. ^ old ^ new
Replace some strings in the previous command.
For example:
Echo "wandreful", in fact, wants to output echo "wonderful ". As long as ^ A ^ o is enough, it will be of great help for spelling long commands.
10. Du-S * | sort-N tail
List the top 10 files in the current directory.
11. Echo "LS-L" | at midnight
Run a command at a certain time.