As a UNIX systems administrator, I am frequently asked how to find a particular pattern or string in a file in which the location of the file is unknown. This is a nifty recursive way of doing that. I routinely use it on the command line.
# /usr/bin/find /etc –type f | xargs grep –i PATTERN
These types of searches can take awhile depending on which directories you are searching.
If you have an alternate method, please share it.
Here's a refined method given by ux-admin- ux-admin said...
-
Tip: to speed the search up, use "-depth", and a case-sensitive `grep`, like so:
find /a/path/ -depth -type f -print | xargs grep the-string-you-are-looking-for