I'm looking for a way to search a directory or directories and list all the files that have the wrong permissions for a public directory.
I'm looking for a way to search a directory or directories and list all the files that have the wrong permissions for a public directory.
Your question could be stated more clearly, esp. what do you mean with "the wrong permissions" for a public directory?
Assuming that you want directories to be 755 and ordinary files to be 644, I'd do it like this:
This worked for me
The
\!
flag means not and the-perm
option uses the normal chmod optionsEverything depends on what do you consider 'incorrect permission'. man find helps you by defining the way how you can look for files/dirs with given permission: