[svlug] Re: [svlug]how to copy a bunch of "." files?

dfox@belvdere.vip.best.com dfox at belvdere.vip.best.com
Sat May 6 10:44:51 PDT 2000

> This is not correct.  The problem with find and its -exec flag is that
> _FOR EACH PARAM GIVEN_ it will _FORK_ off a process to handle the -exec
> request.

I'd tend to agree with you here. The info pages on find(1) seem to
support this -- and using the exec flag to grep through something
like the linux source tree takes a lot longer than it does using
xargs on my system. 

But based on what you said, I'd expect to see a forest of grep
processes running, one per source file in the linux source tree, all
looking for something (for the test, I looked in all source files for
the word 'panic'). I did not notice anything forking new processes,
despite repeated utterances of 'ps alx'. But it took substantially
longer, with more think time at the start of the process than with
an xargs solution.

Furthermore, the xargs gives the data in a better presentation: the
find -exec doesn't give the filenames, but the xargs does (using
find . -name "*.[ch] | xargs grep 'panic' -).

> When I was working on XFS at SGI, two of the test cases I wrote created
> a very deep directory tree (17+ million levels) and a large (30+ million

ouch :).

> Tin Le
David E. Fox                     Census         Thanks for letting me
dfox at belvdere.vip.best.com        2000          change magnetic patterns
Be Counted: http://www.census.gov               on your hard disk.

More information about the svlug mailing list