I have had to do this several times, usually when trying to find in what files a variable or a function is used.
I remember using xargs with grep in the past to do t
If you're looking for a string match, use
fgrep -r pattern .
which is faster than using grep. More about the subject here: http://www.mkssoftware.com/docs/man1/grep.1.asp
grep -r REGEX .
Replace . with whatever directory you want to search from.
.