cut 把一个文件分段
-d 分隔符
-f 第几个字段
-c 第几个字符
-
以冒号分隔,截取第3段
[root@wy ~]# cut -d: -f 3 /etc/passwd
0
1
以冒号分隔,截取第3,6,5段
[root@wy ~]# cut -d: -f 3,6,5 /etc/passwd
0:root:/root
1:bin:/bin
cut 把一个文件分段
-d 分隔符
-f 第几个字段
-c 第几个字符
-
以冒号分隔,截取第3段
[root@wy ~]# cut -d: -f 3 /etc/passwd
0
1
以冒号分隔,截取第3,6,5段
[root@wy ~]# cut -d: -f 3,6,5 /etc/passwd
0:root:/root
1:bin:/bin
上一篇:shell中特殊符号
下一篇:sort命令
cut 命令用途从文件的每个行中写出选定的字节、字符或字段。语法cut { -b
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M