Text viewing and processing tools: WC, cut, Sort, Uniq, diff, Patch
Wc:word Count
WC [OPTION] ... [FILE] ...
-l:lines
-w:words
-c:bytes
Cut
Cut OPTION ... [FILE] ...
OPTION:
-D CHAR: Delimiter with the specified character;
-F Fields: the selected field;
#: The specified single field;
#-#: multiple consecutive fields;
#,#: discrete multiple fields;
Sort
Sort [OPTION] ... [FILE] ...
-N: Sort based on numeric size instead of characters;
-T CHAR: Specifies the delimiter;
-K #: The field used for sorting comparisons;
-R: Reverse order;
-F: Ignore character case
-U: Duplicate lines retain only one copy;
Complex line: continuous and identical;
Uniq: report or remove duplicate rows
Uniq [OPTION] ... [INPUT [OUTPUT]]
-C: Shows the number of repetitions per line;
-U: Displays only rows that have not been duplicated;
-D: Displays only the rows that have been repeated;
Diff:compare Files line by line
diff [OPTION] ... FILES
Diff/path/to/oldfile/path/to/newfile >/path/to/patch_file
-U: Using the unfied mechanism, which displays the context of the row to be modified, the default is 3 rows;
Patch: Patching Files
Patch [OPTIONS]-i/path/to/patch_file/path/to/oldfile
Patch/path/to/oldfile </path/to/patch_file
Exercise: Remove the IP address from the ifconfig eno16777736 command result;
Shell programming (eight) text viewing and processing tools