It counts the amount of occurrences of words in a file and sorts those words.
This script accepts a file as first parameter or it use the stdin if no arguments are given.

Download (gist)

Usage:
1. word_count.py /path/to/myfile.txt
2. cat /path/to/myfile.txt | word_count.py

hints: work_count of all your text file

find ~ -iname '*.txt' | xargs cat | word_count.py
Feb. 12, 2011, 11:19 a.m. index
You are here projects:scripts:word count