Shell basic syntax --- processing huge amounts of data cut command

cut command

  • cut scenarios: usually extracted data column

  • Syntax: cut [options] [file]

    • -d # Specify delimiter

    • -f # interception area designated

    • -c # in characters split

1 # to ' : ' as a separator, taken out of / etc / the passwd first column with the third row
 2  Cut -d ' : ' -f 1 , . 3 / etc / the passwd 
. 3  
. 4 # to ' : ' as a separator , taken out of / etc / the passwd first column to the third column
 . 5  Cut -d ' : ' -f . 1 - . 3 / etc / the passwd 
. 6  
. 7 # at ' : ' as a separator, taken out of / etc / the passwd of two to the last column
 . 8  Cut -d ': ' -F 2 - / etc / the passwd 
. 9  
10 # taken / etc / the passwd file characters from the second to ninth characters
 . 11  Cut -C 2 - . 9 / etc / the passwd

 

Guess you like

Origin www.cnblogs.com/chusiyong/p/11273867.html