find command - don't tranverse subdirectories

Posted on 2006-03-27
Last Modified: 2013-12-27

I have written a find command using GNU find (findutils) to find files greater than 30 mins old, but not in the
subdirectory "sumitted" as:

/usr/local/bin/find ${WO_FAXES_DIR} -name submitted -prune -o -type f -cmins +30 -print

But how can I also skip the $WO_FAXES_DIR/bad subdirectory?
Question by:daveyu
    1 Comment
    LVL 48

    Accepted Solution

    /usr/local/bin/find ${WO_FAXES_DIR} -name submitted -prune -o -name bad  -pune -o -type f -cmins +30 -print

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now