Inventory SUID and SGID executables on one filesystem
Build a paste-ready command, then review its compatibility and effects before running it.
sudo find <path> -xdev -type f \( -perm -4000 -o -perm -2000 \) -printf '%M\t%u:%g\t%p\n' | sortComplete required fields to copy the generated command.
cautionrequires privileges Compatibility
LinuxVerified for Linux using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsfindfind must be installed and available on PATH.Elevated accessReview the exact scope before using an elevated account.
Version supportfind Current supported releasesVerified for linux using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals-rwsr-xr-x root:root /usr/bin/passwdRepresentative successful output; values vary with the selected target and system state.
Known errorsfind: command not foundfind is missing or is not available on PATH.Permission deniedThe current identity does not have the required access.
Verifysudo find {{path}} -xdev -type f \( -perm -4000 -o -perm -2000 \) -printf '%M\t%u:%g\t%p\n' | sortRe-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01sudoPrivilege elevationRuns the following command with elevated privileges after authorization.
02findCommandRuns the find stage of this one-liner.
03<path>ParameterA value supplied in the Fill parameters section.
04-xdevOptionConfigures find with the -xdev option.
05-typeOptionConfigures find with the -type option.
06fArgumentPasses f to find.
07\(ArgumentPasses \( to find.
08-permOptionConfigures find with the -perm option.
09-4000OptionConfigures find with the -4000 option.
10-oOptionSelects an output file or output format for this command.
11-permOptionConfigures find with the -perm option.
12-2000OptionConfigures find with the -2000 option.
13\)ArgumentPasses \) to find.
14-printfOptionConfigures find with the -printf option.
15'%M\t%u:%g\t%p\n'ArgumentPasses '%M\t%u:%g\t%p\n' to find.
16|PipelinePasses the output on the left to the command on the right.
17sortCommandRuns the sort stage of this one-liner.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
sudo find / -xdev -type f \( -perm -4000 -o -perm -2000 \) -printf '%M\t%u:%g\t%p\n' | sort
Example output
-rwsr-xr-x root:root /usr/bin/passwd
-rwsr-xr-x root:root /usr/bin/sudo
-rwxr-sr-x root:ssh /usr/bin/ssh-agent
Illustrative output — exact values vary by system and data.
Official sources