How to find files containing text in Linux

sshRe: Find files containing a specific string of text

This is useful and can save a lot of time, so this is worth remembering!

grep -lir "your text here" *

Here is what the parameters do:

  • r – search recursively in to sub directories
  • i – ignore text case
  • l – output the name of the file and not the line of text

Type man grep for more details.

Was this helpful?
How to find files containing text in Linux written by UKC average rating 5/5 - 1 user ratings