On Sat, 21 May 2005 11:20 pm, James Gray wrote: > On Sat, 21 May 2005 11:12 pm, Voytek Eymont wrote: > > I have tree like: > > > > /home/domain.tld/logs/ > > /home/domain2.tld/logs/ > > ... > > > > how do i run a grep across all logs, as in 'grep a-string /home/*/logs/*' > > man grep > > -R, -r, --recursive > Read all files under each directory, recursively; this is > equivalent to the -d recurse option. > > Makes sense when you think that a lot of Gnu tools use either -r or -R for > recursive modifiers :) eg, > > for DIR in `ls -d /home/*` > do > grep -R a-string $DIR > done
Oops. That script should read: for DIR in `ls -d /home/*` do grep -R a-string $DIR/logs/ done James -- The chicken that clucks the loudest is the one most likely to show up at the steam fitters' picnic. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
