[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to write a script that recursively check files in a directory with md5sum



On Thu, Jul 15, 2004 at 09:05:54AM +0800, John Summerfield wrote:
> I don't use  -exec on find any more because it's slow. When you pipe the 
> names into xargs as I do, then spaces cause the problem I described.

Well, until now I didnt even know about xargs' purpose, thanks for the
pointer.

> For slowness, consider this:
> summer@Dolphin:~$ find ~ -type f | wc -l
> 886076
> summer@Dolphin:~$ find ~ -type f -print0 | xargs -0 | wc -l
> 3990

You're right, xargs is faster (60 times in the case of ls), but only if
the actual command isn't doing very much. For md5sum there is practically
no difference in speed (have just done some measurements).

BTW, what are all those files in your home directory? I have only
about 14000 and thought that this is the biggest mess ever ;)

Regards
Matthias



Reply to: