I was about to suggest using the Plan9 port utilities of the
same name but it seems 'uniq' is not coded to handle Runes
(aka utf-8). I don't imagine it would be hard to re-write it to
handle utf-8.

On Sun, May 7, 2017 at 11:15 AM, Warner Losh <imp@bsdimp.com> wrote:
On Sat, May 6, 2017 at 1:50 PM, Bakul Shah <bakul@bitblocks.com> wrote:
> tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed ${1}q

The cool thing about this thread is that I learned two things: what tr
-s does, and the Nq does for sed...

Sadly, this doesn't work so well for text that isn't ASCII-7 english...

Warner