Main Menu

Search

LINUX: FINDING DUPLICATE LINES IN A FILE WITH COUNT OF DUPLICATE LINE (SORT COMMAND)

Below is command to use.

sort <Filename> | uniq -c -d 

Sample Output.

$ sort list.txt | uniq -c -d 
 2 test-string01 
 2 test-string02 
 2 test-string222 
 2 test-string223 
 2 test-string224 
 2 test-string225 
 2 test-string226 

 


Products to which Article Applies

All Linux Operating Systems 

Search Keywords: sort duplicate line lines all file count linux redundant redundancy mutiple more replica

Article Author: Tarun Boyella

 

No comments:

Post a Comment