14387 shaares
5333 private links
5333 private links
Find files Based On their Permissions
The typical syntax to find files based on their permissions is:
$ find -perm mode
The MODE can be either with numeric or octal permission (like 777, 666.. etc) or symbolic permission (like u=x, a=r+x).
We can specify the MODE in three different ways as listed below.
- If we specify the mode without any prefixes, it will find files of exact permissions.
- If we use "-" prefix with mode, at least the files should have the given permission, not the exact permission.
-
If we use "/" prefix, either the owner, the group, or other should have permission to the file. ///
find . -not -perm -g=r