1. Subject: Confusion re. "find -perm ..."
Hello,
I'm running into behaviour which I don't understand using
"find" on solaris 8 (sun box). I want to find the files and
directories for which "group" and "other" do not have read
permission:
find . \! -perm -go+r -exec ls -l {} \;
This turned up files, some of which "group" and "other" have
read permissions to. This wasn't what I was expecting. As
a sanity check, I tried the opoosite (finding files for
which "group" and "other" *have* read access):
find . -perm -go+r -exec ls -l {} \;
This turns up some files for which "group" and "other" do
*not* have read permission e.g.:
drwx------ 2 fma students 512 Mar 3 06:25 BuildLogs
-r-------- 1 fma students 407 Apr 5 2002 ChangeLog
Here are the selected man page sentences from which I got my
[mis]understanding of the -perm "primary":
-perm [-]mode
The mode argument is used to represent file mode bits.
<<...SNIP...>>
To start, a template will be assumed with
all file mode bits cleared. An op symbol of:
+ will set the appropriate mode bits in the tem-
plate;
<<...SNIP...>>
if mode is prefixed by a hyphen, the pri-
mary will evaluate as true if at least all the bits in
the resulting template are set in the file permission
bits.
Could someone more experienced than I please point out how
my "find" expression departs from the man page in finding
files for which "group" and "other" do (or do not) have read
permission? Thanks.
Fred
--
Fred Ma
Dept. of Electronics, Carleton University
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6
2. linux and w95 networking
3. suppressing 'no perm' msg in find
4. Phone numbers
5. How to 'find -perm' for *unset* modes?
6. kernel rebuild questionns
7. Need to find vi command to remove ^H from command man find > find.txt
8. Q:writing a GUI interface
9. find without the "find: cannot read dir /usr/lost+found: Permission denied"
10. find, find, find
11. Urgent contract & Perm UK Jobs for Solaris Specialists
12. nfs, client side mounting error, no perm's from server
13. Looking for for-hire sysadmin (non-perm, job-by-job basis)