uniq 去除重复命令使用方法介绍
来源:互联网 发布:iphone内存优化 编辑:程序博客网 时间:2024/06/03 17:59
Linux Shell学习:uniq命令使用方法介绍uniq命令的作用:显示唯一的行,对于那些连续重复的行只显示一次!接下来通过实践实例说明. [关键字] Linux Shell uniq
看test.txt文件的内容,可以看到其中的连续重复行
[root@hexu.org ~]# cat test.txt
boy took bat home
boy took bat home
girl took bat home
dog brought hat home
dog brought hat home
dog brought hat home
uniq命令不加任何参数,仅显示连续重复的行一次
[root@hexu.org ~]# uniq test.txt
boy took bat home
girl took bat home
dog brought hat home
-c 参数显示文件中每行连续出现的次数。
[root@hexu.org ~]# uniq -c test.txt
2 boy took bat home
1 girl took bat home
3 dog brought hat home
-d选项仅显示文件中连续重复出现的行。
[root@hexu.org ~]# uniq -d test.txt
boy took bat home
dog brought hat home
-u选项显示文件中没有连续出现的行。
[root@hexu.org ~]# uniq -u test.txt
girl took bat home
忽略每行的前2个字段,忽略第二个空白字符和第三个字段的首字符,结果at home
[root@hexu.org ~]# uniq -f 2 -s 2 test.txt
boy took bat home
忽略每行的第一个字段,这样boy ,girl开头的行看起来是连续重复的行。
[root@hexu.org ~]# uniq -f 1 test.txt
boy took bat home
dog brought hat home
- uniq 去除重复命令使用方法介绍
- uniq命令使用方法介绍
- linux uniq命令(去除排序之后的重复)
- Linux 命令行去除重复 uniq
- linux 去除重复行 uniq
- linux uniq 命令介绍
- uniq 去除重复行或统计
- Linux uniq --去除排序过的文件中的重复行
- 实例详细说明linux下去除重复行命令uniq
- 实例详细说明linux下去除重复行命令uniq
- shell除去重复的行——uniq命令
- 实例详细说明linux下去除重复行命令uniq
- 实例详细说明linux下去除重复行命令uniq
- linux用uniq命令----过滤、统计、删除重复行
- uniq命令
- uniq命令
- uniq命令
- 【命令】uniq
- js 鼠标跟随小例子
- 大话设计模式(五)观察者模式
- mysql调整max_connections和max_user_connections及php模拟并发测试
- Android Studio设置工具栏等字体
- 单例设计模式
- uniq 去除重复命令使用方法介绍
- 详情介绍webpack-dev-server,iframe与inline的区别
- 获取当前客户端IP
- snprintf()函数的返回值
- 数据库设计 采用左右值编码来存储无限分级树形结构_1 预排序遍历树算法(modified preorder tree traversal algorithm )
- PHP 项目优化 curl
- vertical-align && line-height
- 深入理解javascript中的立即执行函数(function(){…})()
- div+css命名规范