From owner-freebsd-questions@FreeBSD.ORG Fri Feb 10 16:25:02 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDA6E1065670 for ; Fri, 10 Feb 2012 16:25:02 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 37E718FC13 for ; Fri, 10 Feb 2012 16:25:02 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [IPv6:2001:8b0:151:1:fa1e:dfff:feda:c0bb]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id q1AGOwtv065671 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Fri, 10 Feb 2012 16:24:58 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: OpenDKIM Filter v2.4.3 smtp.infracaninophile.co.uk q1AGOwtv065671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1328891098; bh=21UZxCRdbLoaFysh7h1PpPnee52+bs/1zyk36cC3CNo=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Cc; b=NLd9yz9Cu/AUZk+gBI1p7uaRO0Cko4QnEafFdb1AgGFFEF8gD6IDWvdCTKYKyHoRX HAP/LgZcDdbUjh2C0yHpmaEx8TEx+pmUoYyaYLf9/Cqd5xNQUeDr+ixkYweRq2BJVt bt9JcMW8K6GTB7yx/VoPe6VRwD1CdathdBavJb8k= Message-ID: <4F3544DA.8010003@infracaninophile.co.uk> Date: Fri, 10 Feb 2012 16:24:58 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> <4F353D1F.3020100@herveybayaustralia.com.au> In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8F6ED172D39762DBCAF4EDEE" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Subject: Re: 'rm' Can not delete files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:25:02 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8F6ED172D39762DBCAF4EDEE 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 -- >=20 > or some such, depending on your needs, I believe in most situations thi= s > 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. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enig8F6ED172D39762DBCAF4EDEE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk81RNoACgkQ8Mjk52CukIzgZwCZAfQazm4OMKaqPhUuxycQ1r6w JJIAoIaoMdVVUjvuidjcZfb4zlmGOz4P =4Mk2 -----END PGP SIGNATURE----- --------------enig8F6ED172D39762DBCAF4EDEE--