Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] recursive tree log grep ?

<quote who="Christopher JS Vance">
> On Sat, May 21, 2005 at 11:12:22PM +1000, Voytek Eymont wrote:

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

thanks, Christopher
yes, they are all same depth, but., my string failed with:

# grep "elite" /home/*/logs/*
bash: /bin/grep: Argument list too long

yours seems to work, though, thanks