Apr 2, 2020

Find duplicates in a file in Unix

Below will display the number of occurrences and the record
sort filename.dat|uniq -c

Display only duplicates
sort filename.dat|uniq -d

Display only distinct records
sort filename.dat|uniq

No comments:

Post a Comment