How do I find a word recursively in all files and all directories

I am looking for a specific phrase in CentOS and I am not sure where and which file or even directory that has the file is. How can I do a complete recursive search on a phrase. Thanks


man grep
For this example, grep -i -R "your phrase" directory
-i means case insensitive
-R means recursively

If you don't know which directory, use / - but be prepared for it to take a long time.


You can use this one liner to get a list of all files in this folder and sub folders, containing the phrase "The phrase I am looking for".

  find . -print0 | xargs -0 grep "The phrase I am looking for" -l

I would recommend ack.

Go to the uppermost level directory that you dare searching and then type:

ack -a "Phrase"

I don't really use grep anymore because of ack.