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

Random Posts

Previous Posts