This can be a interview question for even advanced linux users.


Here is the command : grep -o spellword file | grep wc -w 


( where spellword = name of the word you want to count and file is the name of the file )


Result : You will find the result based on occurrence of specific word.