cut 用法备忘

[root@localhost ~]# cut --help
用法:cut [选项]... [文件]...
Print selected parts 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 ----常用 start form 1
that contains no delimiter character, unless
the -s option is specified
-n with -b: don't split multibyte characters
--complement 补全选中的字节、字符或域
-s, --only-delimited 不打印没有包含分界符的行
--output-delimiter=字符串 使用指定的字符串作为输出分界符,默认采用输入
的分界符
--help 显示此帮助信息并退出
--version 显示版本信息并退出

仅使用f -b, -c 或-f 中的一个。每一个列表都是专门为一个类别作出的,或者您可以用逗号隔
开要同时显示的不同类别。您的输入顺序将作为读取顺序,每个仅能输入一次。
每种参数格式表示范围如下:
N 从第1 个开始数的第N 个字节、字符或域
N- 从第N 个开始到所在行结束的所有字符、字节或域
N-M 从第N 个开始到第M 个之间(包括第M 个)的所有字符、字节或域
-M 从第1 个开始到第M 个之间(包括第M 个)的所有字符、字节或域

当没有文件参数,或者文件不存在时,从标准输入读取

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
请向<http://translationproject.org/team/zh_CN.html> 报告cut 的翻译错误
要获取完整文档,请运行:info coreutils 'cut invocation'

posted @ 2021-04-08 09:55  Xuperior  阅读(73)  评论(0编辑  收藏  举报