“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"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)