Since we dont have uniq

Here is it, and it doesnt even need a sort

Basically it goes line by line and only prints it if it hasnt been seen

cat text.txt | awk '!a[$0]++'

If you want to sort the output afterwards (sort by frequency of occurrence)

cat text.txt | awk '!a[$0]++' | sort

The end.

Leave a Reply

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