Sort/Uniq

From wiki
Jump to navigation Jump to search


sort <filename>
cat <filename>|sort
Print the content of <filename> sorted.
sort -u
Sort and print all unique values
sort -n
sort numeric
sort -t"," -k3
Sort on the 3rd field using ',' as field seperator
uniq -d
Print all values that exist more than once
uniq -D
Print all lines with duplicate values