shell脚本之uniq命令
2016-10-17 18:41
85 查看
uniq
用来检查文件中重复出现的行列,并且删除重复部分。
用法:uniq [选项]... [文件]
-c, --count prefix lines by the number of occurrences
-d, --repeated only print duplicate lines, one for each group
-D, --all-repeated[=METHOD] print all duplicate lines
groups can be delimited with an empty line
METHOD={none(default),prepend,separate}
-f, --skip-fields=N avoid comparing the first N fields
--group[=METHOD] show all items, separating groups with an empty line
METHOD={separate(default),prepend,append,both}
-i, --ignore-case ignore differences in case when comparing
-s, --skip-chars=N avoid comparing the first N characters
-u, --unique only print unique lines
-z, --zero-terminated end lines with 0 byte, not newline
-w, --check-chars=N 对每行第N 个字符以后的内容不作对照
--help 显示此帮助信息并退出
--version 显示版本信息并退出
若域中为先空字符(通常包括空格以及制表符),然后非空字符,域中字符前的空字符将被跳过。
常用选项说明:
– c 显示输出中,在每行行首加上本行在文件中出现的次数。
– d 只显示重复行。
– u 只显示文件中不重复的各行。
用来检查文件中重复出现的行列,并且删除重复部分。
用法:uniq [选项]... [文件]
-c, --count prefix lines by the number of occurrences
-d, --repeated only print duplicate lines, one for each group
-D, --all-repeated[=METHOD] print all duplicate lines
groups can be delimited with an empty line
METHOD={none(default),prepend,separate}
-f, --skip-fields=N avoid comparing the first N fields
--group[=METHOD] show all items, separating groups with an empty line
METHOD={separate(default),prepend,append,both}
-i, --ignore-case ignore differences in case when comparing
-s, --skip-chars=N avoid comparing the first N characters
-u, --unique only print unique lines
-z, --zero-terminated end lines with 0 byte, not newline
-w, --check-chars=N 对每行第N 个字符以后的内容不作对照
--help 显示此帮助信息并退出
--version 显示版本信息并退出
若域中为先空字符(通常包括空格以及制表符),然后非空字符,域中字符前的空字符将被跳过。
常用选项说明:
– c 显示输出中,在每行行首加上本行在文件中出现的次数。
– d 只显示重复行。
– u 只显示文件中不重复的各行。
相关文章推荐
- 常用shell脚本命令总结(添加中。。。)
- shell脚本学习-6(sed命令学习)
- Linux脚本Shell命令
- 几个常用shell脚本命令
- shell脚本中的sort命令
- shell脚本一:简单命令declare read ==
- shell脚本学习:不得不细心之sed和grep,sort和uniq,从细节看“认真”
- shell 高级脚本命令
- shell脚本中的``导致sed命令解析失败
- linux强大的查询字符匹配命令和shell脚本
- shell脚本学习-7(sed命令学习)
- shell脚本--检查文件是否存 cut命令详解
- shell脚本学习-11(cut命令学习)
- 脚本shell中的tr 命令使用与实例
- SHELL脚本的基础知识2——使用结构化命令
- shell脚本学习-5(sed命令学习)
- shell脚本学习-10(tr、uname、chkconfig命令学习)
- shell 脚本之程序流程控制命令(1)
- 在shell脚本里执行sudo 命令
- Shell 脚本常用命令