我有一个 data.txt 文件如下
1
1
100
100
1
1
1
当我尝试时,
more 'data.txt|uniq'
连续多次出现的uniq值
1
100
1
有没有办法,我可以得到这样的结果
1
100
提前致谢
最佳答案
尝试执行
$排序-u数据.txt
描述:
根据 uniq 的手册页
Note: 'uniq' does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use 'sort -u' without 'uniq'.
你可以通过执行阅读联机帮助页
$ 男人独特
关于linux - 如何从Linux中的文件中获取唯一出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16784957/