How to Find Files Containing Specific Text27 November 2016
How to find files containing a specific text recursively in Unix / Linux system? I typically use
grep like this:
grep -rnw "pattern" /path/to/file
-rmeans recursively search
-nadds line number
-wmatches the whole word, so remove it if you want partial match
-ifor case insensitive search, but it’s a bit slow. Note that grep is case insensitive by default.