From owner-freebsd-questions@FreeBSD.ORG Sun Dec 23 01:30:33 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B71620D for ; Sun, 23 Dec 2012 01:30:33 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.freebsd.org (Postfix) with ESMTP id 87ED38FC12 for ; Sun, 23 Dec 2012 01:30:31 +0000 (UTC) Received: from slackbox.erewhon.net (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id qBN1K9Eb078598; Sun, 23 Dec 2012 02:20:09 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.erewhon.net (Postfix, from userid 1001) id 6FCA112720; Sun, 23 Dec 2012 02:20:09 +0100 (CET) Date: Sun, 23 Dec 2012 02:20:09 +0100 From: Roland Smith To: Jack Mc Lauren Subject: Re: exclude directories from find command Message-ID: <20121223012009.GA11934@slackbox.erewhon.net> References: <1356186164.16227.YahooMailNeo@web160104.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <1356186164.16227.YahooMailNeo@web160104.mail.bf1.yahoo.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: FreeBSD Global Users Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2012 01:30:33 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 22, 2012 at 06:22:44AM -0800, Jack Mc Lauren wrote: > Hi fellas > How can I exclude specific directories from my find command ? I want to l= ook for all files in the whole system except for those in e.g /extra direct= ory.=A0 > I use this command to find all files, but how can I exclude /extra direct= ory ? >=20 > find / -type f Try this: find / -type f -not -path '/extra/*' Roland --=20 R.F.Smith http://rsmith.home.xs4all.nl/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlDWXEkACgkQEnfvsMMhpyW5tQCeIe/az8QhYB4PIrGmMdGxEGaF PcMAnRVZ3COHTFg5/DYtRA0s2YUY0Ogn =h/rf -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--