Linux命令详解cut命令
1.cut命令
cut - remove sections from each line of files
2.参数详解
- -f:指定输出某个字段
-f, --fields=LIST
select only these fields; also print any line that contains no delimiter character, unless the -s option is specified
- -d:指定使用某个分隔符
-d, --delimiter=DELIM
use DELIM instead of TAB for field delimiter
3.示例
[root@server4 shells]# echo 'asd;hello;wawa;' | cut --delimiter=';' -f1
asd
[root@server4 shells]# echo 'asd;hello;wawa;' | cut -d\; -f1
asd