how to search a word in file and count how many time a word appera in file code example Example: count occurrences of word in unix bash $ grep -o -i needs inspire.txt | wc -l