Last Updated: July 05, 2016
·
156
· jtremblay

get word count in a text using shell cmd

This will count how many time each word appears in a text

$ cat file | sed "s/\b/\n/g" | sort | uniq -c | sort -rn > word.count
$ cat word.count
41 the
32 of
30 ,
25 and