Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2012 16:24:58 +0000
From:      Matthew Seaman <>
Subject:   Re: 'rm' Can not delete files
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 10/02/2012 16:04, Matthew Story wrote:
> find . -type f -depth 1 -print0 | xargs -n99 -0 -s8192 -c5 rm --
> or some such, depending on your needs, I believe in most situations thi=
> particular invocation will also out-perform find ... -delete.

Why would you believe that? find ... -delete calls unlink(2) directly on
each file it finds as it searches the directory tree given that it
matches the other find predicates.

Whereas find ... -print0 | xargs ... rm ... involves a whole complicated
sequence of find doing the same searching and matching job, then
marshalling lists of filenames, piping them between processes, then
xargs exec(2)ing rm with chunks of that arglist; each rm invocation then
finally ... calling unlink(2) on each of the named files.

Actually, I doubt you'ld see much difference above the noise in the
speed of either of those two commands: they're both going to spend the
vast majority of the time waiting for disk IO, and that's common to any
way of doing this job.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID:               Kent, CT11 9PW

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla -



Want to link to this message? Use this URL: <>