Simple, though doesn't care if it reads the file many times:
sed 's/ /\n/g' file.txt | sort | uniq | while read -r word; do printf "%s:%d\n" "$word" "$(grep -Fw $word"$word" file.txt | wc -l)" done EDIT: Despite converting spaces to newlines, this does count lines that have an occurrence of each word and not the occurrences of the words themselves. It gives the result:
0:1 1:1 2:1 a:1 different:1 hello:1 is:3 man:2 one:1 possible:1 the:3 this:1 world:2 which is character-by-character identical to OP's example result.