Text Processing: Cat, TAC, more, less, head, tail, cut, sort, uniq, grep
Regular expressions
Pipelines and redirects: > < >> <<
Users, Groups, permissions
View text: Cat, TAC, more, less, head, tail
Cat (CONCATENATE): Connect and display
-N: Display line number-e: Display line terminator (for Linux, the line terminator of the text file shi$,windows the line terminator is $/n)
TAC: Connection and display (inverted)
Split screen view: More (Turn back, turn to the end of the file automatically exit) less (can be turned around, turn to the end of the file will not automatically exit, only enter Q exit)
Head: View top N rows tail: View the last n rows support-n Display line numbers
Tail-f: Look at the end of the file, do not exit, wait to display the new content appended to this file later
Text processing: Cut, join, SED, awk
Cut: Cut
-D: Specify delimiter, default is space-F: Specifies the field to display,-F 1,3-f 1-3
Example: cut-d:-F 1,7 file displays files as: 1th and 7th parts of separators
Text sort: Sort (sort and cut does not affect the source file's data, just displayed on the screen) by default is sorted by ASCLL ascending order
- N: Sort by numeric value-r: Reverse order, descending- T: Set delimiter-K: Specifies the field to display-u: the same line after sorting only shows once sort-u is equivalent to Uniq -F: Ignore character capitalization when sorting
Uniq: -C: Displays the number of repeats in a file-D: Show only duplicate rows
Text statistics: WC (word count)
-L: How many lines-W: How many words-C : How many characters-L: The longest line contains the number of characters
Character processing command: TR---convert or delete characters
For example: tr ' A-Z ' A-Z ' </etc/passwd converts A-Z in a file to a A-Z
-D: Delete all characters that appear in the character set
This article is from the "11254884" blog, please be sure to keep this source http://11264884.blog.51cto.com/11254884/1971027
2017-10-9linux Text Processing