[Scottish] Best way to find text within files recursively?

Graeme Mathieson scottish at mailman.lug.org.uk
Sat Jan 18 20:49:00 2003


On Sat, Jan 18, 2003 at 07:55:38PM +0000, Allan Whiteford wrote:
> 
> In a slightly more convoluted way, but one in which can be applied
> easily to any command to give recursive capabilities:
> 
> grep -l myfriend@somewhere.org `find .`
> 
> (Note the direction of the quotes, and also filenames with spaces will
> probably mess things up.)

It's also going to break grep if find returns too many results.  And
find there will return directories too, which grep will not take too
kindly to.  My SOP recursive grep is:

find . -type f -print0 |xargs -0 grep 'foo'

OTOH, I've no idea offhand why I don't just use rgrep (aka `grep -r`)...
:-)
-- 
Right now, there are scr1pt k1dd13s plotting to DDoS my network, my co-lo
server is not responding  to pings and  the people that I IRC with may be
involved in both.  I'm  sysadmin Graeme Mathieson and this is the longest
day of my life.                       http://www.wossname.org.uk/~mathie/