How to Find Files with Specific Permission Settings in unix ?

The UNIX administrator needs to know how to find files with specific security settings. Here are a few examples of the find command.

1. Find all SetUID files in and under the current working directory (.).

% find . -type f -perm -4000 -print

2. Find all SetGID files in and under the current working directory (.).

% find . -type f -perm -2000 -print

3. find all world-writable files in and under the current working dir- ectory (.).

% find . -type f -perm -o+w -print

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA *