Find Files Containing Text

You may always pipe the output of commands through grep to find specific words, but it can also be used to find files that contain a text string:

grep -lir "some text" *

The -l switch outputs only the names of files in which the text occurs (instead of each line containing the text), the -i switch ignores the case, and the -r descends into subdirectories.

JunHu: JunHu/Memo/FindingFilesContainingText (last edited 2008-10-03 20:18:34 by localhost)