Text file:
1 1 2 2 3 3 1 1
I want to catch 1 1
as duplicated
Text file:
1 1 2 2 3 3 1 1
I want to catch 1 1
as duplicated
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