cut -b list [-n] [file ...]
cut -c list [file ...]
cut -f list [-d delim] [-s] [file ...]
各个参数的含义:
-b list
The list specifies byte positions.
以字节为单位进行分割
-c list
The list specifies character positions.
以字符为单位进行分割
-d delim
Use delim as the field delimiter character instead of the tab character.
自定义分隔符,默认为制表符
-f list
The list specifies fields, separated in the input by the field delimiter character (see the -d option.) Output fields are separated by a single occurrence of the field
delimiter character.
和-d一起使用,指定显示哪个filed。
-n Do not split multi-byte characters. Characters will only be output if at least one byte is selected, and, after a prefix of zero or more unselected bytes, the rest of
the bytes that form the character are selected.
取消分割多字节字符。仅和 -b 标志一起使用。
如果字符的最后一个字节落在由 -b 标志的 List
参数指示的<br />范围之内,该字符将被写出;
否则,该字符将被排除
-s Suppress lines with no field delimiter characters. Unless specified, lines with no delimiters are passed through unmodified.
抑制没有字段分隔符的行。
除非指定,否则没有定界符的行将不加修改地通过。
详细示例请参见:cut命令详解