提中的这些命令都是些小命令,很简便,在工作过程中经常使用,具体使用方法如下:
cut
使用说明:一般是把某个整齐的文档输出其中某列使用
常用的参数有:
-f 选择打印的列
-d 指定分界符
--complement 打印选择列之外的列
cat employee.txt
name,sex,age zhangsan,male,25 lisi,male,30 wangwu,female,23
如上employee.txt文件,可以使用如下的命令打印性别这一栏:
cut -f 2 -d ","employee.txt
使用如下命令打印除第二列之外的其他俩列:
cut -f 2 --complement empoyee.txt