页次: 1
看一个示例
# cat a.txt this is one this is three this is two this is two this is three this is three [root@qd ~]# uniq a.txt this is one this is three this is two this is three [root@qd ~]# sort -u a.txt this is one this is three this is two
这里可以看到 是一样的, sort -u 去除了所有重复的行。
而 uniq 是只有相邻的行相同的时候,保留一个,去除其他的。就是说不管几个保留一个。
ipbbs.net
离线
页次: 1