find question

Brian Fahrlander brian at fahrlander.net
Sat Jul 14 17:41:38 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

H.S. wrote:
> Brian Fahrlander wrote:
>> H.S. wrote:
>>> Pete Holsberg wrote:

[snipped]

> Put the full path of the directory to be ignore before "-prune". So you
> would try:
> $> find /var/1wire -path '/var/1wire/bus.0' -prune -o -name
> "[0-9A-F][0-0A-F]\.[[0-9A-F]*" 2>/dev/null
> 
> Or, you may want to use '*bus*' instead to exclude every path with bus
> in it. Or maybe '/var/1wire/bus*' to exclude directories starting with
> bus in /var/1wire.
> 
> To exclude multiple directories you need to use the OR construct using
> "-o" like so (to exclude /var/1wire/bus* and /var/1wire/foo* ):
> $> find /var/1wire \( -path '/var/1wire/bus.0' -o -path
> '/var/1wire/foo*' \) -prune -o -name "[0-9A-F][0-0A-F]\.[[0-9A-F]*"
> 2>/dev/null

    Yeah, I was just adding one deleted-component at a time, trying to
prove that even one worked; I wasn't going well.

    But, worst-case, I could always add "} grep -v "bus" | grep -v
"alarm" | grep -v "uncached" to the pipleline.  It actually works, but
I'd really like to get the hang of using the "newer" features of find
properly, ya know?

    (There actually are some new features that have crept-in since I was
last using them so often. Like how 'date' now understands terms like
'yesterday' and such...things go well for the cause, aye? )

    :)

- --
 ------------------------------------------------------------------------
 Brian Fahrländer                 Christian, Conservative, and Technomad
 Evansville, IN                              http://Fahrlander.net/brian
 ICQ: 5119262                         AOL/Yahoo/GoogleTalk: WheelDweller
 ------------------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGmQrS6PLtRzZbdhYRAvvkAJ4xghmGMKfIqZY1nqsHzDT7SiZNvQCeMwnE
v6ONuQqWL5T8ug5ZmSwB2iE=
=jYeE
-----END PGP SIGNATURE-----




More information about the ubuntu-users mailing list