Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2012 02:20:09 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        Jack Mc Lauren <jack.mclauren@yahoo.com>
Cc:        FreeBSD Global Users Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: exclude directories from find command
Message-ID:  <20121223012009.GA11934@slackbox.erewhon.net>
In-Reply-To: <1356186164.16227.YahooMailNeo@web160104.mail.bf1.yahoo.com>
References:  <1356186164.16227.YahooMailNeo@web160104.mail.bf1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121223012009.GA11934>