I was looking at the stack trace of a stack overflow exception, and it’s looong (1172 lines). I wanted to just see which lines occurred most often. Easy enough with the right incantation of sort and uniq.
$ < stack.txt sort | uniq -c | sort -rh | head