exclude directories from find command

2012-12-22 Thread Jack Mc Lauren
Hi fellas
How can I exclude specific directories from my find command ? I want to look 
for all files in the whole system except for those in e.g /extra directory. 
I use this command to find all files, but how can I exclude /extra directory ?

find / -type f

Thanks in advance ... 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: exclude directories from find command

2012-12-22 Thread Jens Jahnke
Hi,

On Sat, 22 Dec 2012 06:22:44 -0800 (PST)
Jack Mc Lauren jack.mclau...@yahoo.com wrote:

JML How can I exclude specific directories from my find command ? I
JML want to look for all files in the whole system except for those in
JML e.g /extra directory. I use this command to find all files, but
JML how can I exclude /extra directory ?
JML 
JML find / -type f

what about find / -type f | grep -v ^\/extra ? ;)

Regards

-- 
22. Julmond 2012, 15:33
Homepage : http://www.jan0sch.de

For flavor, instant sex will never supersede the stuff you have to peel
and cook.
-- Quentin Crisp


pgplgQWuOaL9G.pgp
Description: PGP signature


Re: exclude directories from find command

2012-12-22 Thread RW
On Sat, 22 Dec 2012 06:22:44 -0800 (PST)
Jack Mc Lauren wrote:

 Hi fellas
 How can I exclude specific directories from my find command ? I want
 to look for all files in the whole system except for those in
 e.g /extra directory. I use this command to find all files, but how
 can I exclude /extra directory ?
 
 find / -type f
 

Try this

http://lmgtfy.com/?q=find+exclude+a+directory


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: exclude directories from find command

2012-12-22 Thread Bas Smeelen

On 12/22/12 15:22, Jack Mc Lauren wrote:

Hi fellas
How can I exclude specific directories from my find command ? I want to look 
for all files in the whole system except for those in e.g /extra directory.
I use this command to find all files, but how can I exclude /extra directory ?

find / -type f


find -path /extra -prune -o -type f



Thanks in advance ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: exclude directories from find command

2012-12-22 Thread Roland Smith
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 look 
 for all files in the whole system except for those in e.g /extra directory. 
 I use this command to find all files, but how can I exclude /extra directory ?
 
 find / -type f

Try this:

  find / -type f -not -path '/extra/*'

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


pgpgCfbf85Cpi.pgp
Description: PGP signature