Find files by permissions using find -perm
The -perm primary of find matches files by their octal permission bits, letting you audit for world-writable files or confirm that binaries carry the mode you expect.
Run `find . -type f -perm -002` to list files that are writable by others, or `find . -type f -perm 755` for an exact mode match.
01Command
Command
$ find /usr/local/bin -type f -perm -002
find . -type f -perm 75502What it does
A mode prefixed with a dash (e.g. -perm -002) matches files that have all of those bits set, while a bare number like 755 requires an exact match. This is a fast way to audit scripts shared on disk for overly permissive modes before tightening them with chmod.
03Risk
!Warning: An exact `-perm 755` will not match files with mode 775; remember the dash-prefix form when auditing for 'at least these bits'.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- find — search for files and directories (macOS)Evidence: Documents the -perm test with octal modes and the -002 symbolic prefix semantics.
Last verified: 2026-09-17 · Category: Files & Folders