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
Written by jtremblay
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#