Find Files by Permission

Build a find -perm command to list files or directories by mode on Linux and macOS.

Find filters

The dot starts the search in your current directory. The command prints matching paths.

Compare an octal mode with the permission filter before you run the command.

How find -perm matches modes

Exact mode
-perm 0644 finds a mode of exactly 0644. A file with mode 0664 has an extra group-write bit and falls outside the match.
All selected bits
-perm -0022 requires both group and other write permission. It matches 0666 and allows extra bits.
Any selected bit
For 0022, use an OR to match group write, other write, or both. The builder groups the OR so that the entry type filter applies to both branches. GNU find also accepts -perm /0022 as a shorthand.

The leading digit includes setuid, setgid and sticky bits. find -perm compares those bits and the usual read, write and execute bits. For an account’s effective access, check Linux ACLs and parent directory permissions.

Convert permissions to octalCheck Git file modesGNU find mode bits reference