Paul Schmehl <[email protected]> writes:

> --On February 15, 2011 12:57:12 PM +0300 Peter Andreev
> <[email protected]> wrote:
>
>> Use of "xargs" on many files will be much faster than "find...exec"
>> construction
>>
>> find / -type f -name copyright.htm | xargs sed -i .bak -e 's/2010/2011/g'
>>
>
> I believe you, but can you explain why this is true?  What makes xargs
> faster than exec?

Classically, exec always spun off a new process for each exec (i.e.,
every single file).

For years now, find(1) has had a POSIX-standard syntax (ending the
command with a '+' syntax for the end of an -exec line, which does
pretty much the same thing in a single command.

Sometimes, the command being used only handles one filename at a time,
and -exec is necessary.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to