sort file | uniq -c | sort -n #### 1 foo 3 bar 8 blah