count number of words in the file linux code example
Example 1: count number of lines in directory linux
find . -name '*.php' | xargs wc -l
Example 2: find number of occurances of a string in a file shell
$ grep -o -i needs inspire.txt | wc -l
find . -name '*.php' | xargs wc -l
$ grep -o -i needs inspire.txt | wc -l