Linux – how to find files with incorrect permissions on unix

findlinuxpermissionsunix

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.

Best Answer

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:

$ find \! -perm 644 -type f -o \! -perm 755 -type d