Sort & uniq in Linux shell

后端 未结 6 1604
没有蜡笔的小新
没有蜡笔的小新 2021-01-30 10:41

What is the difference between the following to commands?

sort -u FILE

sort FILE | uniq
6条回答
  •  不知归路
    2021-01-30 11:14

    sort -u will be slightly faster, because it does not need to pipe the output between two commands

    also see my question on the topic: calling uniq and sort in different orders in shell

提交回复
热议问题