Linux: How to generate list of unique lines in a text file


We have two methods:

Method 1:

cat ok.txt | uniq > ok2.txt

Method 2:

sort -u ok.txt >> ok2.txt

Leave a Reply