Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.shell Subject: Re: Why use find? (Was: Can U pipe filenames to rm???) Message-ID: <1990Oct6.055108.14853@smsc.sony.com> Date: 6 Oct 90 05:51:08 GMT References: <1990Sep30.182331.14363@iconsys.uucp> <941@hls0.hls.oz> <1990Oct5.145825.9454@diku.dk> Organization: Sony Microsystems Corp, San Jose, CA Lines: 16 In article <1990Oct5.145825.9454@diku.dk> kimcm@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.