Mike,
You can speed up your find commands by an order of magnitude by using xargs.
The problem with -exec is that it uses (like most makes) a shell for every
command. It also does poorly when there is a huge amount of output from the
find.
As an example, if we rewrite:
find . -type d -exec ls -ldF {} \;
as:
find . -type d -print | xargs ls -ldF
we find quite a bit of speedup:
3.222u 11.121s 0:21.74 65.9% 0+0k 161+0io 9pf+0w
3.238u 11.210s 0:20.26 71.2% 0+0k 52+2io 14pf+0w
vs:
0.297u 1.686s 0:02.30 85.6% 0+0k 24+1io 6pf+0w
0.282u 1.673s 0:02.18 89.4% 0+0k 5+0io 4pf+0w
(Note to time the above I had to put both find commands in shell scripts; time
doesn't like timing things with a pipe)
The only drawback to using xargs vs. -exec, is the problem with pipes: it can
take a while before the pipe is filled an you see some output. But the speedup
is usually worth it.
xargs is quite versatile. It can do inserts with the braces (like find) and it
can even pass a fixed number of arguments to each invocation of the command
passed to it. Check out the man page.
-uttam
-- +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+ | Uttam M. Narsu E-mail: narsu@hks.com | | | | Hibbitt, Karlsson & Sorensen, Inc. Tel: (401) 727-4200 x 4442 | | 1080 Main Street, Pawtucket RI 02860 Fax: (401) 727-4208 | +-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+-=+