Shell script commands
Diff
diff file1 File2 Compare two files in different
Rows around-C
-U output patches in a uniform format
-R Compare the differences in the directory
Patch File File.path Patching
-C Back up the original file
Grep
grep Key Character File | directory finds rows with keywords in a file or directory
-I ignores case
-n Displays the keyword in the row
-C Display the number of filter results
-V Reverse Filter
-e "keyword 1| keyword 2" filters multiple keywords
-R directory to find the files in the directory that have a key word
Note: The ^ keyword starts with a keyword
Keyword $ ends with keyword
Cut
Cut intercept characters
Cut-d delimiter Development delimiter
Cut-f 1,7 display make column
Cut-c 1-4 Displays the enactment character
Sort sorts
Sort-n Pure Digital Sorting
-U de-redundancy
|uniq-c Remove redundancy and count the number of redundancies
-T Specify delimiter
-k Specifies the column
Uniq
Sort file |uniq-c Remove redundancy and count redundant times
Number
-D Show redundant rows
-U displays unique rows
Tr ' A-Z ' A-z ' file character substitution (case)
Sed
Sed ' s/original character/replacement character/g ' file
Sed-e ' Strategy 1 '-e ' policy 2 ' file
Sed-i file to enter the converted content into the specified files
Sed ' 3,5s/original character/replace character/g ' file replace 3-5 lines
SED xd mask specified line
Sed XP replicates the specified line
Sed-n XP displays only the specified lines
Linux Learning Note 9