Help with Unix Find Command for Red Hat

Is there a way to format a Unix find command that will search all filesystems for all instances of device files, sgid and suid files?  We have a requirement to baseline our systems so we have something to compare against in case new files of these types show up later.


Who is Participating?
Maciej SConnect With a Mentor sysadminCommented:
find / -perm /4000 -o -perm /2000
This will find suid (4000) and sgid (2000) files.
If this doesn't work, you may try replacing '/' with '+', but this is deprecated way.

All device files are located in /dev/. To get full list, you may use:
find /dev/ -print
simple ls /dev/ command.

I think you can use following command to have listed all files you want:
find / \( -perm /4000 -o -perm /2000 -o -type c -o -type b \)
You may also add "-ls" option to above find command (after ending "\)") to have output similar to the one you can get with ls -l file.
netwrkedAuthor Commented:
Works great, many thanks for an easy solution!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.