Re: OT: find command permissions: how to exclude dir?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rick Stevens wrote:
Gordon Messmer wrote:
You need to tell find what to do with files not named .gvfs:

find /users/tburns -name .gvfs -prune -o -print

Will not work.  As soon as the non-owner of .gvfs does a stat on the
directory, the error will be spit out.  find must "stat()" any item
it finds to handle the remainder of the predicate and POP goes the
error.

If -name is the first predicate, and you prune matches, find will not need to stat() the directory entry:

[gordon@herald:~/tmp/findtest]$ find . -print
.
./noread
find: `./noread': Permission denied
./read
./read/file

[gordon@herald:~/tmp/findtest]$ find . -name noread -prune -o -print
.
./read
./read/file

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux