how to search for a word in text file using shell script code example Example: find text in any file linux grep -rnw '/path/to/somewhere/' -e 'pattern'