Find list of files missing read & execute permission

Hi,

I'm writing a post-upgrade script and I want to find which files don't have read and execute to everyone.

I can run a

find . ! -perm

, but then I have to use a list of the possible permissions (777,775, 755 etc). Is there a more elegant solution?

Thanks

Would -perm -mode or -perm /mode (if available with your version) help?

1 Like

The command:

find . ! -perm -05

will give you the names of all files in the file hierarchy rooted in the current directory that are not both readable and executable by userIDs that are not in the file's owner or group classes. If you want to find files that aren't readable and executable by anyone:

find . ! -perm -0555
1 Like