Skip to content

Instantly share code, notes, and snippets.

@kamalbanga
Created April 23, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamalbanga/6d26d80961c06bf36903 to your computer and use it in GitHub Desktop.
Save kamalbanga/6d26d80961c06bf36903 to your computer and use it in GitHub Desktop.
Doug Mcllroy's solution to "find n most frequent words in a file"
tr -cs A-Za-z '\n' |
tr A-Z a-z |
sort |
uniq -c |
sort -rn |
sed ${1}q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment