Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] recursive tree log grep ?


On Sat, May 21, 2005 at 11:12:22PM +1000, 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/*'

If the logs are all immediately in the relevant logs directory, what
you've typed in your question is a good start.  If the logs appear at
different directory depths, then maybe you need find and xargs.  Say
something like

	find /home/*.*/logs -type f | xargs grep a-string

--
Christopher Vance