On Monday 13 February 2006 17:13, Stuart Henderson wrote: > On 2006/02/13 16:53, Jason Crawford wrote: > > On 2/13/06, Matthias Kilian <[EMAIL PROTECTED]> wrote: > > > On Mon, Feb 13, 2006 at 02:03:27PM -0700, Diana Eichert wrote: > > > > find /usr/src -name "*.[c|h]" -exec grep 'bpf.h' /dev/null {} \; > > it's in quotes, this is handled by find, not the shell. > > > > (b) pipeing to xargs(1) may be faster. > > > > why? >
As done by find -exec, correct? > grep foo 1 2 3 4 5 6 7 ... > > vs. > As done by xargs? > grep foo 1 > grep foo 2 > grep foo 3 > ... Wouldn't for a small list -exec be faster as it is a single invocation of the grep vs multiple invocations of grep for xargs. IIRC, the reason xargs exists is to get around limits posed by the number of args an application like rm or grep can take when passed a large list of arguments like, say, a recursive find for old files in your spam quarantine :-). Tim Donahue