You can use the grep command with the -c option to count the occurrences of a specific word in a file.