Your question is not quite clear, but you can filter out duplicate lines with uniq
:
sort file.txt | uniq
or simply
sort -u file.txt
(thanks RobEarl)
You can also print only repeating lines with
sort file.txt | uniq -d
Your question is not quite clear, but you can filter out duplicate lines with uniq
:
sort file.txt | uniq
or simply
sort -u file.txt
(thanks RobEarl)
You can also print only repeating lines with
sort file.txt | uniq -d