Remove duplicate lines using uniq
Display all the lines sorted in alphabetic order:
sort file_name
Now show only the unique lines:
sort file_name | uniq
And finally save the unique lines in a new file:
sort file_name | uniq > file_name_uniques
Display all the lines sorted in alphabetic order:
sort file_name
Now show only the unique lines:
sort file_name | uniq
And finally save the unique lines in a new file:
sort file_name | uniq > file_name_uniques
February 22nd, 2010 at 6:45 am
Easy and simple step to remove duplicate lines.I think it will works great. By using uniq now we can easily delete the duplicate lines.
Thanks for sharing..