Counting words/characters (Why I like Unix)


(No, not me. Him.)

Word frequencies


cat hfinn10.txt
  | tr '[:punct:]'  ' '
  | tr ' ' '\012'
  | sort
  | uniq -c
  | sort -n
  | tail -20

Character frequencies


cat hfinn10.txt
  | sed 's/./&~/g'
  | tr '~' '\012'
  | sort -n
  | uniq -c
  | sort -n
  | tail -20

more plumbing magic …


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.