Bash command - cut

extracting data fields and cut columns

Extract data columns:

1. cut -c 1,3,5 file data extraction column 1,3,5

2. cut -c 1-5 file data extraction columns 1-5

3. cut -c 1,3-5 file data of the first extraction column and row 3-5

4. cut -? C 3-5 file> new columns 3-5 and extract data saved to the new

Extracting data fields

1. cut -f 1 -d ':' file to extract the first field, the field with the use of ':' spaced

2. cut -f 1,3-5 -d '' file to extract the first field and 3-5, separated by spaces field

Output line 3. cut -sf 3-5 -d '::' file extracted 3-5 field, and does not inhibit the delimiter '

Guess you like

Origin www.cnblogs.com/xiaodi-js/p/12614574.html