Print the number of occurrences of letter ‘t’ in ‘sample.txt’ linux 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