Text file:
1 1 2 2 3 3 1 1
I want to catch 1 1
as duplicated
To start your duplicate search, go to File -> Find Duplicates or click the Find Duplicates button on the main toolbar. The Find Duplicates dialog will open, as shown below. The Find Duplicates dialog is intuitive and easy to use. The first step is to specify which folders should be searched for duplicates.
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
One way using GNU awk
:
awk 'array[$0]++' file.txt
Results:
1 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With