[email protected]:~/user/txt$ cat test.txt
1 chen nihao
2 chen hello
3 li nimenhao
4 he dajiahao
5 li nimenhao
[email protected]:~/user/txt$ sort -k2,2 -u test.txt
1 chen nihao
4 he dajiahao
3 li nimenhao
[email protected]:~/user/txt$ cat test1.txt
1 chen nihao
2 chen hello
3 li nimenhao
4 he dajiahao
5 li nimenhao
6 she nimenhao
[email protected]:~/user/txt$ sort -k3,3 -u test1.txt
4 he dajiahao
2 chen hello
1 chen nihao
3 li nimenhao
时间: 2024-10-12 16:34:50