Skip to content

Instantly share code, notes, and snippets.

@wx13
Created March 1, 2013 16:47
Show Gist options
  • Save wx13/5065970 to your computer and use it in GitHub Desktop.
Save wx13/5065970 to your computer and use it in GitHub Desktop.
one-liner to get word frequencies from a file
strings $1 | sed 's/[^a-zA-Z0-9]/\n/g' | egrep '[a-zA-Z]{5}' | tr '[:upper:]' '[:lower:]' | awk '{++a[$1]}END{for(x in a){print a[x], x}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment