Viewing 1 to 3 of 3 items
Archive | sort RSS feed for this section

sort command

sort  – sort a file in sorted order beginning of each line sort [options]… [file] -b Ignores spaces at beginning of the line. -c Check whether input is sorted; do not sort -d Uses dictionary sort order and ignores the punctuation. -f Ignores caps -g Ccompare according to general numerical value -i Ignores nonprinting control  Full Article…


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…