1、
root@PC1:/home/test# ls test.txt root@PC1:/home/test# cat test.txt 1 3 8 1 3 5 1 7 root@PC1:/home/test# sort test.txt | uniq -d ## 取出重复项 1 3 root@PC1:/home/test# sort test.txt | uniq -u ## 取出唯一项 5 7 8
root@PC1:/home/test# ls a.txt root@PC1:/home/test# cat a.txt 1 3 8 1 3 5 1 7 root@PC1:/home/test# sort -u a.txt ## 去除重复后剩余的所有唯一项 1 3 5 7 8 root@PC1:/home/test# sort a.txt | uniq ## 同上 1 3 5 7 8
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。