首页 > 其他 > 详细

uniq和tee命令

时间:2017-01-12 16:10:52      阅读:186      评论:0      收藏:0      [点我收藏+]

uniq   去重复

-c   计算重复的数量

注:uniq去重,它只会去相邻挨着的相同的字符,如果达到真正的去重,先用sort排序。

[root@wy ~]# cat 1.txt

1

1

2

3

2

4

[root@wy ~]# uniq 1.txt

1

2

3

2

4

[root@wy ~]# sort 1.txt |uniq -c

2 1

2 2

1 3

1 4


tee   重定向、双重输出

与>重定向的最大区别,tee可以直接显示出来

[root@wy ~]# echo "1111111111" > 1.txt

[root@wy ~]# cat 1.txt

1111111111

[root@wy ~]# echo "11111111" | tee 1.txt

11111111


本文出自 “linux” 博客,转载请与作者联系!

uniq和tee命令

原文:http://warm51fun.blog.51cto.com/3884274/1891390

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!