1, cut back to the previous directory
The code is as follows:
CD-
The horizontal bar represents the path to the previous directory
-is actually a built-in variable $owd
2. Replace a phrase from the previous command
The code is as follows:
^foo^bar^
The original style of this command should be
The code is as follows:
!!:gs/foo/bar/
!! Indicates that the previous command is repeated, with the following: Gs/foo/bar for the replacement operation.
3. Quickly backup a file
The code is as follows:
CP Filename{,.bak}
Curly braces are an arrangement of meaning, you can try the following example
The code is as follows:
echo {A,b,c}{a,b,c}{a,b,c}
Will output the full array of three sets
The code is as follows:
AAA AAB AAC ABA ABB ABC ACA ACB ACC
Baa Bab Bac bba bbb BBC bca BCB bcc
CAA cab CAC CBA CBB CBC CCA CCB CCC
4. Empty or create a file
The code is as follows:
: >file.txt
: is the shell default NULL function
5, reset
The code is as follows:
Rest
If you have tried accidentally cat a binary file, it is likely that the entire terminal silly off, may not change lines, can not be back to show, large pile of garbled and so on, you may type reset command, no matter whether the command has shown, it will be able to return to normal
6, more friendly display of the currently mounted file system
The code is as follows:
Mount |column-t