The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Security
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 03-25-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Quote:
Originally Posted by altamaha View Post
I am using the suggested fi[n]d command, but I do not know how one would use the "greater than" check against the permission bits.
GNU find at least has some more advanced options for this. Is installing it an option?

Also, even with regular basic old-skool BSD find, I don't really think you need to painstakingly repeat the -type f -- just add parentheses, but note that you have to backslash-escape them because they are special to the shell, too.

Code:
find $MANDIR -type f \( -perm -7 -o -perm -6 -o -perm -5 -o -perm -3 -o -perm -2 -o -perm -1 \)
Of course, if you want to say "any bit except 4", that is doable too, at least with GNU find:

Code:
find $MANDIR -type f -perm /3
Also look at find2perl -- its documentation is somewhat terse but if you can't quite say what you want with the bare find(1) options, it might be less frustrating to make minor edits to a generated Perl script. Quick Googling brought up this brief tutorial
Reply With Quote