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