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

Allan Whiteford scottish at mailman.lug.org.uk
Sat Jan 18 19:55:01 2003


scottish+Steven.Murdoch@cl.cam.ac.uk wrote:
> 
> > for (every folder in this directory)
> >       grep -l myfriend@somewhere.org *
> 
> Would "grep -rl myfriend@somewhere.org *" do what you want?
> 
> Steven Murdoch.
> 
> _______________________________________________
> Scottish mailing list
> Scottish@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/scottish

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.)

Thanks,

Allan
-- 
The average person's left hand does 56% of the typing.