linux count how many times word occure in file code example
Example 1: count occurrences of word in file linux
grep -wc "your_text" FileName
Example 2: linux count number of times word appears in file
grep -o 'word' filename | wc -l
grep -wc "your_text" FileName
grep -o 'word' filename | wc -l