0192.sh (283B)
1 // original 2 for word in $(tr ' ' '\n' < words.txt | sort | uniq); do grep -o "\<$word\>" words.txt | wc -l | xargs echo $word; done | sort -k2 -nr 3 4 // using uniq -c instead of counting word by word 5 cat words.txt | tr -s ' ' '\n' | sort | uniq -c | sort -nr | awk '{ print $2, $1 }'