Ravi Sir's Cards › AWS
sort vs uniq
This comparison card contrasts sort and uniq. sort is described as orders lines. uniq is described as removes neighbour repeats.
Read card text
What this card says
Job
sort
Orders lines.
uniq
Removes neighbour repeats.
Key points
-n -h -k -u -r options.
-c count, -d dups, -u single.
Example
sort -nr a.txt
Use when
Rankings.
Counting repeats.