uniq和tee命令
2017-01-12 14:34
148 查看
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
-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
相关文章推荐
- shell 知识点补充(2)-重定向/ ; , &&, ||/管线命令/grep/sort/ uniq/wc/tee/tr/col/join/paste/expand/split/-
- Linux下Bash的管线pipe命令,cut,grep,sort,wc,uniq,tee,tr,col,join,past,expand
- linux学习第二十五篇:cut,sort,wc,uniq,tee,tr,split命令,shell特殊符号
- linux的cut、sort_wc_uniq、tee_tr_split命令及一些特殊符号介绍
- shell特殊符号,cut、sort、wc、uniq、tee、tr、split命令
- Linux下Bash的管线pipe命令,cut,grep,sort,wc,uniq,tee,tr,col,join,past,expand
- shell特殊符号、cut_sort_wc_uniq命令和tee_tr_split命令
- shell特殊符号cut命令,sort_wc_uniq命令,tee_tr_split命令
- Linux CentOS 7 shell中的特殊字符及与管道相关的命令(cut,sort,wc,uniq,tee,tr,split)
- shell特殊符号cut命令,sort、wc、uniq命令,tee、tr、split命令
- Linux管线命令 - cut,grep,sort,uniq,wc,tee,tr,col,join,paste,expand,split,xargs
- 1.8 uniq和tee命令
- Linux命令-cut、sort、uniq、wc、tee
- shell特殊符号、cut命令、sort_wc_uniq命令、tee_tr_split命令、shell特殊符号下
- uniq和tee命令
- 一天一linux命令(16) cut sort wc uniq tee split 较常用命令
- linux系统中cut sort tee 和uniq命令的使用
- linux下uniq和tee命令
- 11.17 shell特殊符号cut命令,sort_wc_uniq命令,tee_tr_split命令,shell特殊符号
- shell特殊符号cut命令、sort_wc_uniq命令、tee_tr_split命令、shell特殊符号下