1. switch back to the previous Directory. the cd-horizontal bar represents the path of the previous Directory. the built-in variable $ owd2 is used to replace the original style of the command ^ foo ^ bar ^ in the previous command. it should be !! : Gs/foo/bar /!! Indicates to execute the previous command again and use: gs/foo/bar to replace it. 3. quickly back up a file
1. switch back to the previous directory.
cd -
The horizontal bar indicates the path of the previous directory.
-It is actually a built-in variable $ owd.
2. replace a phrase in the previous command
^foo^bar^
The original style of this command should be
!!:gs/foo/bar/
!! Indicates to execute the previous command again and use: gs/foo/bar to replace it.
3. quickly back up a file
cp filename{,.bak}
Braces are an arrangement. you can try the following example:
echo {a,b,c}{a,b,c}{a,b,c}
Lists all the three output sets.
aaa aab aac aba abb abc aca acb accbaa bab bac bba bbb bbc bca bcb bcccaa cab cac cba cbb cbc cca ccb ccc
4. clear or create a file
:>file.txt
: It is an empty function that exists by shell by default.
5. reset
If you accidentally cat a binary file, it is very likely that the entire terminal will be dumb, it may not wrap the line, it will not be able to display it back, and there will be a lot of garbled code, etc, you can run the reset command to restore the system to normal regardless of whether the command is displayed or not.
6. more friendly display of the currently mounted file system
mount |column -t