linux command to count amount of each word in file code example
Example 1: command to find the count of only words in a file in linux
wc -w <filename>
wc --words <filename>
Example 2: linux count number of times word appears in file
grep -o 'word' filename | wc -l