Re: Re: rm -rf is too slow on large files and directory structure(Around 30000)
> But may provide some benefit when removing a large number (30000) of
> files (at least empty ones).
>
> cbell@circe:~/test$ time find rm -type f -exec rm {} \;
>
> real 0m48.127s
> user 1m32.926s
> sys 0m38.750s
First thought - how much of that 48 seconds was spent on launching
30000 instances of rm? It would be instructive to try
time find rm -type f -exec rm {} \+
or the more traditional xargs:
time find rm -type f -print0 | xargs -0 -r rm
Both of those commands should minimise the number of rm instances.
Similarly for unlink.
--
Cheers,
Clive
Reply to: