Help with Unix Find Command for Red Hat

Posted on 2009-02-14
Last Modified: 2013-12-06
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.


Question by:netwrked
    LVL 23

    Accepted Solution

    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.

    Author Closing Comment

    Works great, many thanks for an easy solution!


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Users are often faced with high disk consumption without really knowing where the largest amount of data resides. Disk Usage Analyzer (aka Baobab) is is a graphical, menu-driven application to analyse disk usage in any Gnome environment and can e…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now