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