1.cd
CD-Back to last catalog
CD returns the current user's home directory
2.mkdir
Mkdir-p Creating a multilevel directory
Eg:mkdir-p Test1/test2/test3
3.find
Find-empty Finding empty Documents
Find-user XXX View all information about user xxx
Find-mtime-1 view files that have been modified within 1 days
Find-mtime +1 view files that were modified 1 days ago
4.du
Du-h Human Vision
Du-s only show Total capacity
5.head
Head-c 2K Display pre-2KB content
Head-n Display the contents of the top N rows
6.wc
Wc-l Statistics File Line
Wc-c Statistics File characters
Wc-w statistics File Words
7.grep
Grep-i ignoring case
Grep-v Inverse Matching
Grep-w matching Words
grep--color Display Color
8.ln
Ln-s Creating a soft connection
LN creates a hard link
9.vim
HLJK corresponds to the upper or lower
GG move cursor to first line of file
G move cursor to end of file
NG moves the cursor to n rows
^ cursor moves to the current line start character
$ cursor moves to the end character of the current line
FX cursor moves to the next X character
FX cursor moves to the first X character
W cursor moves one word to the right
b The cursor moves one word to the left
NW,NB cursor Left/Right move n words
DD deletes the cursor in the row
NDD Delete N rows
d$ Delete cursor to end of line
J Delete line breaks
U Undo Previous Action
Rx replaces the current character of the cursor with the X
YY copy when moving forward
p after pasting to current line
P Paste before current line
/from top down, n next n prev
? From the bottom of the online check, n next n prev
: S/xxx/bbb/g replaces the current line of XXX for BBB
:%s/xxx/bbb/g replaces all lines of XXX for BBB
: 1,5s/xxx/bbb/g replaces 1-5 lines of XXX for BBB
ZZ Save and exit
: Set Nu (or number) displays line numbers
Tips for Shell common commands