Diff
diff file File1 to compare two different files
-C display rows around the top and bottom
-U uniformly output patches in a certain format
-R comparison of files in two directories
Patch File File.path Patching
-B Plus-B backup source files
grep
grep Key Character File | Directory finds rows in a file or directory that contain keywords
Grep-i ignoring case
-n Displays the keyword in the row
- C Show Filter Knot Number of fruits
-V Reverse Filter
- e "keyword 1| keyword 2" filters multiple keywords
-R directory to find files in the directory that contain keywords
Note: The ^ keyword starts with a keyword
Keyword $ ends with keyword
Cut
Cut intercept characters
Cut-d delimiter Specifies delimiter
Cut-f 1.7 Displays the specified column
Cut-c 1-4 shows first to fourth characters
Sort sorts
-N Pure Digit sort
-U de-redundancy
|uniq-c Redundancy and Count redundancy
-T Specify delimiter
-k Specifies the column
Uniq
Sort-n file |uniq-c redundancy and Count redundancy
-D Show redundant rows
-U displays unique rows
Sed
Sed ' s/original character/replacement character/g ' file
Sed-e ' Strategy 1 '-e ' strategy 2 '
Sed-i file to enter the converted content into the specified files
Sed ' 3,5s/original character/replacement character/g ' 3-5 line substitution
Sed ' 3s/original character/replacement character/g ' 3rd line substitution
SED xd mask specified line
Sed XP replicates the specified line
Sed-n XP displays only the specified lines
awk
awk ' condition type {action 1} condition type {action 2} ... ' filename
Awk primarily handles data in the fields of each row, and the default field delimiter is the Space or TAB key
awk numeric operator
+ +--increase and decrease (front or rear)
^** index (right binding)
! +-Non, unary plus, unary minus
*/% multiply, divide, remainder
+-Add, subtract
<<===!=>>= comparison
&& Logic and
|| Logical OR
? : Ternary Conditional type
=+=-=*=/=%=^=**= Assignment (right-associative)
awk built-in scalar variables
FileName The name of the current input file
FNR the number of records for the current input file
FS field delimiter (regular expression)
NF the number of fields currently logged
NR number of records at Work (job)
OFS output Field delimiter
ORS Output Record delimiter
RS Input Record delimiter
This article from the "12147236" blog, reproduced please contact the author!
"Linux rookie 2" Shell Base command