You are here

Finding files containing a string

To find all files in directory <directory> and its subdirectories, containing string <string>:

grep -rn <directory> -e "<string>"

with:

  • -r: read all files  under  each  directory,  recursively
  • -n: prefix  each  line of output with the 1-based line number within its input file