Count the words in a text and display them
grep and coreutils &nbsp;44&nbsp; 42

grep -io '[a-z0-9]*'|sort|uniq -c|sort -nr


Test:

printf "This is a text and a number: 31." |
grep -io '[a-z0-9]*'|sort|uniq -c|sort -nr


Results in:

  2 a
  1 This
  1 text
  1 number
  1 is
  1 and
  1 31


Update


Use case-insensitive option and shorter regex. Thanks Tomas.