find number of occurances of a string in a file shell

C++
$ grep -o -i needs inspire.txt | wc -l
Source

Also in C++: