Pipeline command
If our data has to go through a "few formalities" before we can get the format we want then we have to use the pipe command to solve this problem
* * Pipeline commands are not the same as sequential execution commands
Let's take a look at the processing information flow for pipeline commands
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7F/FC/wKiom1czNVSjrtv3AAAlrYwg13Q965.png "title=" Linux Foundation 47. PNG "alt=" Wkiom1cznvsjrtv3aaalrywg13q965.png "/>
Application of Pipeline command
1.Cut
* * For selecting part of the data
-D: Specify delimiter
-F: Data segment selected after-D delimited
-C: Specifies that the numbers are split in characters to fetch the top position data,
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/F9/wKioL1czNiig8jMGAADnBAo3pc8530.png "title=" Linux Foundation 41. PNG "alt=" Wkiol1czniig8jmgaadnbao3pc8530.png "/>
The main purpose of **cut is to decompose the same row of data
2.grep
* * For parsing a row of data
-A: Finding data in a text file as a binary file
-C: Calculate the number of occurrences of ' string '
-I: Ignoring case differences
-N: Output line number
-V: Reverse selection, showing the line where ' string ' was not found
--color=auto: Add a color display to the part of the keyword found
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/FC/wKiom1czNSaAsj0uAABoUtwTawc008.png "style=" float: none; "Title=" Linux base 42. PNG "alt=" Wkiom1cznsaasj0uaaboutwtawc008.png "/>
**grep can be used for regular expressions here we don't repeat
3. Sort commands
A.sort
* * can be sorted according to different data types
numbers and text are sorted differently, so it's best to unify the language when you need to sort (lang=c)
-F: Ignore case differences
-B: Ignore the first whitespace section
-M: Sort by month name
-N: Sort with a pure number, default is text type
-R: Reverse Sort
-U: Same data appears only once
-T: delimiter, default to [tab]
-K: Sort after split interval
Eg: sorted in third column for: Delimited
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/FC/wKiom1czNSjzbc9VAAFzr38r14s273.png "style=" float: none; "Title=" Linux base 43. PNG "alt=" Wkiom1cznsjzbc9vaafzr38r14s273.png "/>
B.Uniq
* * You can use this command to delete duplicate rows after sorting is complete (only once)
-I: Ignore case differences
-C: Counting
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/F9/wKioL1czNgqw77KUAAE-5AkvBZ8638.png "style=" float: none; "Title=" Linux base 44. PNG "alt=" Wkiol1czngqw77kuaae-5akvbz8638.png "/>
c.WC
* * overall data for calculating the output information
-L: List only travel
-W: Only How many words (English word)
-M: List only characters
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/FC/wKiom1czNSvhvtz2AAC6gdvvMTE223.png "style=" float: none; "Title=" Linux base 45. PNG "alt=" Wkiom1cznsvhvtz2aac6gdvvmte223.png "/>
* * We can use CAT/ETC/PASSWD | wc-l to calculate the number of accounts in our current account file .
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/F9/wKioL1czNgvjTtTiAABLktX_biE835.png "style=" float: none; "Title=" Linux base 46. PNG "alt=" Wkiol1czngvjtttiaablktx_bie835.png "/>
do you think it's interesting? 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0002.gif "alt=" J_0002.gif "/> (Continuous update ...)
This article is from the "Zimomo" blog, make sure to keep this source http://zimomo.blog.51cto.com/10799874/1772391
Linux Essentials four ——— Pipeline command