Grep
command grep to search for text based on keywords
grep ' HHL '/etc/passwd
-I ignores case
-N Displays the number of rows in which the result
-V Output lines without keywords
-ax the specified number of rows after the row of the result is included in the output
-BX the specified number of rows before the result row is included in the output
processing text based on columns
Command cut to process text content based on columns
Cut-d:-f1/etc/passwd
grep hhl/etc/passwd | Cut-d:-f1
-D Specify delimiter
-f Specifies the output column number
Text statistics
Command WC for statistical text information
-L Number of rows
-W Word
-C Word Count
-M character Count
Text sorting
Sort the text content by command sort
-R Reverse
-N Sort By numbers
-F ignores case
-U Delete Duplicate rows
-T C uses C as a delimiter to sort columns
-K x when sorting based on the specified character as a column, specify sort based on that column
Text comparison
Diff command
Diff AA Aa-new
-I ignores case
-B Ignore the comparison of the number of spaces
-U Unified Display comparison information
Working with text content
command TR to process text content
Delete keyword
tr-d ' keywords ' < target directory
Transformation
TR AA AA < target directory (convert AA to AA)
Search replacement
Sed to search for and replace text
Sed ' regular expression ' target file
Linux Text Processing