count the number of occurrences of a word in a file unix code example Example: count occurrences of word in unix bash $ grep -o -i needs inspire.txt | wc -l