how to use word count to find number of times a string is used terminal code example
Example 1: count occurrences of word in unix bash
$ grep -o -i needs inspire.txt | wc -l
Example 2: linux count number of times word appears in file
grep -o 'word' filename | wc -l