cut
语法格式
cut OPTION [FILE]
cat file|cut [option]指定输出的字符
# a b c
> cut -f1 -s a.txt
a# a,b,c,d
> cut -d',' -f4 a.txt # 以,为分隔符
d反向匹配
设置输出格式
输出范围
最后更新于
# a b c
> cut -f1 -s --complement a.txt
b c> cut -d',' -f1-3 -s --output-delimiter=' ' a.txt
a b c