1、cut命筠沭鱿漆令怎么用,可以使用cut命令查看[root@zuozuo ~]# cut --help用法:cut [选项]... [文件]...Print selected p锾攒揉敫arts of lines from each FILE to standard output.Mandatory arguments to long options are mandatory for short options too. -b, --bytes=列表 只选中指定的这些字节 -c, --characters=列表 只选中指定的这些字符 -d, --delimiter=分界符 使用指定分界符代替制表符作为区域分界 -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified -n with -b: don't split multibyte characters
2、使用cut切割之前,我们先看下文档的样式。比如passwd文档采用分号隔开。
3、首先是cut -d 接切割符,来切割内容显示。
4、使用cut -d "切割符' 使用单引号或双引号都可以。
5、cut -d:切割符 -f接切割后的字段
6、cut -c1-3 表示 cut使用切割字符串位置来切换
7、如果要切换的字符串不是连续的,可以使用逗号来分割
8、cut -b表示对某个列表进行截图截图字段。
9、总结:1.默认cut是内醅呓择锗置linux命令,首先确认使用什么方式来切割2.cut -d后面接切割字段,进行切割3.cut -c 表示使用指定字符串,进行切割