"grep -rnw": search for a string in all files "grep -rnw": search for a string in all files linux linux

"grep -rnw": search for a string in all files


explainshell helpfully explains your command, and gives an excerpt from man grep:

   -w, --word-regexp          Select  only  those  lines  containing matches that form whole words. 

So just remove -w since that explicitly does what you don't want:

grep -rn '/path/to/somewhere/' -e "pattern"