I would use tr instead of awk:
echo "Lorem ipsum dolor sit sit amet et cetera." |
tr '[:space:]' '[\n*]' |
grep -v "^\s*$" |
sort |
uniq -c |
sort -bnr
trjust replaces spaces with newlinesgrep -v "^\s*$"trims out empty linessortto prepare as input foruniquniq -cto count occurrencessort -bnrsorts in numeric reverse order while ignoring whitespace
wow. it turned out to be a great command to count swear-per-lines
find . -name "*.py" -exec cat {} ; | tr '[:space:]' '[\n*]' | grep -v "^\s*$" | sort | uniq -c | sort -bnr | grep fuck