Skip to content

Instantly share code, notes, and snippets.

@uilian
Created February 12, 2024 23:56
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 uilian/7a0f5775bc450080473356b214a6806c to your computer and use it in GitHub Desktop.
Save uilian/7a0f5775bc450080473356b214a6806c to your computer and use it in GitHub Desktop.
McIlroy solution for printing the most common words in a text file in the inverse order of the count of their occurrences
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