Viewing 1 to 2 of 2 items
Tag Archives: Dc 3

Remove duplicate lines with uniq

After sorting a file you will often find that some duplicate data, or you may be given various lists that need deduping. sort and uniq will quickly and easily remove duplicates, lsit only the dupilcates or only the unique data. sort myfile.txt | uniq List only the unique lines: sort myfile.txt | uniq -u List only the duplicate lines: sort myfile.txt  Full Article…

0

Remove duplicate in file lines with uniq and cat

Listing 1. Removing duplicate lines with uniq $ cat happybirthday.txt Happy Birthday to You! Happy Birthday to You! Happy Birthday Dear Tux! Happy Birthday to You! $ sort happybirthday.txt Happy Birthday Dear Tux! Happy Birthday to You! Happy Birthday to You! Happy Birthday to You! $ sort happybirthday.txt | uniq Happy Birthday Dear Tux! Happy  Full Article…

0