cut

来源:互联网 发布:淘宝的神笔在哪里 编辑:程序博客网 时间:2024/05/18 13:25
基于列处理文本内容
cut -d: -f1 /etc/passwd
grep wudi /etc/passwd | cut -d: -f1-3


-d 指定分割字符(默认TAB)
-f 指定输出的列号
-c 基于字符进行切割,cut -c2-6 /etc/passwd
0 0