Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created October 5, 2013 21:08
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 fakenickels/6846039 to your computer and use it in GitHub Desktop.
Save fakenickels/6846039 to your computer and use it in GitHub Desktop.
A simple shell script that shows and enumerates the most frequently words used in a file
# Show and enumerate the most frequently words in a file
# Use:
# $ chmod a+x frequently_words.sh
# $ ./frequently_words file_path
cat $1 | tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment