Why use find? (Was: Can U pipe filenames to rm???)

David Elliott dce at smsc.sony.com
Sat Oct 6 15:51:08 AEST 1990


In article <1990Oct5.145825.9454 at diku.dk> kimcm at diku.dk (Kim Christian Madsen) writes:
>>Why use `xargs' when you don't need to ?
>
>There are a lot of uses of xargs that are superior to using find with the
>exec option. Find is *SLOW*, so if you have the names of files you want to
>do something with in a file or pipe use xargs for performance.

I think you mean that fork()/exec() is slow.

Find itself is quite reasonable, since it precompiles the predicates
and then runs down the filesystem tree.  Piping to xargs lets find do
the job it does best very quickly.

You're right about it being complicated, though.  Writing interpreted
language syntax on a command line without any newlines can be pretty
messy.



More information about the Comp.unix.shell mailing list