find -perm

Find files by their permission bits

find / -perm -4000 finds all SUID binaries. find /tmp -perm 777 finds world-writable files. Security audits always include a find -perm sweep.

Example

$ find / -perm -4000 -type f 2>/dev/null
/usr/bin/passwd
/usr/bin/sudo
Tip: Type it yourself in the terminal below - reading is not the same as doing.