Remove Duplicates in Text File

So I have a list of names, but the names are duplicated down the page. Each name is on a new line by itself.

If I want to remove all the duplicates and just find out who is included in the file, I can simply do:

awk '!seen[$0]++' filename

This will remove duplicates and print them to your terminal.

Leave a Reply

Your email address will not be published. Required fields are marked *