I want to identify all files which does not have any permission for others irrespective of any permission for user and groups . How the find command will look like. e.g

drwxrws--- 2 jboss  users 4096 Sep 14  2012 answ
find . ! \( -perm -o=r -o -perm -o=w -o -perm -o=x \) 
  • 2
    Why not ! -perm /007? Is that less compatible? – Hauke Laging Jan 22 '16 at 7:55
  • @HaukeLaging - no, but i don't even think that works for anything. what is the / supposed to do? anyway, -perm 0007 only matches files for which every permission bit is off except all of the other bits. So it doesn't match dwrxwrxwrx or dwrxrw-rw- or any of that. Splitting them out and -o ring the three bits with the - hyphen works to match any file for which any other permission bit is set. – mikeserv Jan 22 '16 at 8:05
  • /007 is disjunction. You could just have given it a try... – Hauke Laging Jan 22 '16 at 8:11
  • @HaukeLaging - I did just give it a try and it was syntax error. What is disjunction? – mikeserv Jan 22 '16 at 8:12
  • @HaukeLaging - I guess w/ GNU find that does work. It's usually not at the fore of $PATH on my system, though, because it's kind of slow. The AST find can do most of what it can - and a lot more besides - but also hooks into the locate database - and so is usually by far my most preferred find to find first in $PATH, – mikeserv Jan 22 '16 at 8:20
find . ! -perm /007                ### In GNU find.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.