a sort+uniq snippet

A favorite little command-line snippet:

| sort | uniq -c | sort -nr and then pipe the result to a pager or redirect to a file

For example, to see how many times people have logged in, in decreasing rank order:


last | awk '{ print $1 }' | sort | uniq -c | sort -nr | less

25 views and 0 responses