From owner-freebsd-questions@FreeBSD.ORG Fri Nov 4 18:09:02 2011 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 6E3FE106564A for ; Fri, 4 Nov 2011 18:09: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:3fd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id F2C748FC13 for ; Fri, 4 Nov 2011 18:09:01 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.5/8.14.5) with ESMTP id pA4I8rDX019604 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 4 Nov 2011 18:08:54 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: OpenDKIM Filter v2.4.1 smtp.infracaninophile.co.uk pA4I8rDX019604 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1320430134; bh=a9WRIeHlV41g77dxX8We8raqzcLpauRpKZFgTasJBWs=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=xXjwwn/t2g8trS/MRHS/4qcviMRZg/VlwRGudb7iJNS1zfViFDP6POyh00E7Akp2r a9Nh8erffrl05/hjLaZbkTuNHbEYeCIRJZiQUiRXEYLE1jVTI6EBHlvoAKU2Ch+o0k AIgYWZ3/Huh+8G/txUReNdXtsbeFdFNYXsGjRufc= Message-ID: <4EB42A2C.2030704@infracaninophile.co.uk> Date: Fri, 04 Nov 2011 18:08:44 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Rodrigo Gonzalez References: <0EE458C34045A44DBC2CA2DC5CEB42B5239647FE05@mercury.universe.galaxy.lcl> <4EB423CD.6040702@estrads.com.ar> In-Reply-To: <4EB423CD.6040702@estrads.com.ar> X-Enigmail-Version: 1.3.2 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA964D57777CBEE52CA92D859" X-Virus-Scanned: clamav-milter 0.97.3 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_FAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk Cc: "freebsd-questions@freebsd.org" , Graeme Dargie Subject: Re: removing directories 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, 04 Nov 2011 18:09:02 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA964D57777CBEE52CA92D859 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 04/11/2011 17:41, Rodrigo Gonzalez wrote: > El 04/11/11 13:25, Graeme Dargie escribi=F3: >> Ok this might be a bit of a newbie question but here goes. >> >> I have a large number of directories around 300 which all have sub >> dirs, some of those have sub dirs in each of these there are two >> further sub dirs called pages and thumbnails, is there an easy way to >> remove all the pages and thumbnail dirs from the tree? >> >> Regards >> >> G >> > I dont know how to make in one command....but to delete thumbnails > directories >=20 > find . -type d -name thumbnails -exec rm -rf {} \; >=20 > You can do the same for the pages directories >=20 > To test what you will delete please run >=20 > find . -type d -name thumbnails -print >=20 > and see that it is correct In one command: find . -depth 3 -type d \( -name pages -o -name thumbnails \) \ -exec rm -rf '{}' + The '-depth 3' bit avoids deleting any pages or thumbnails directories higher up the tree, assuming that any such exist. Leave it out if that isn't a concern. Use -print as Rodrigo suggests to avoid foot-shooting scenarios... 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 --------------enigA964D57777CBEE52CA92D859 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/ iEYEARECAAYFAk60KjUACgkQ8Mjk52CukIxz9wCfUpxzF9QWnnW02TilxTXB5nF6 IPsAoIMrnxtD/rDzklGQrYs+N05BQGHq =svcx -----END PGP SIGNATURE----- --------------enigA964D57777CBEE52CA92D859--