Help with the find command

From: Stephen Spalding (ssaixadm_at_YAHOO.COM)
Date: 11/17/03

  • Next message: Mohamed Kamal: "Re: Help with the find command"
    Date:         Mon, 17 Nov 2003 12:37:33 -0800
    To: aix-l@Princeton.EDU
    
    

    All,

    I'm writing a script to clean up files under a certain
    directory that are over a certain amount of time old.
    I'm using the find command to do this. However, I do
    not want the find command to traverse any
    subdirectories underneath the directory that I've
    specified. I don't want to have to name each and every
    subdirectory under the directory that's being cleaned
    up.

    Here's an example of what I'm doing. The directory
    name is /stephen. This directory has a bunch of files
    under it and two subdirectories: /stephen/files and
    /stephen/tmp. I want the find command to completely
    ignore /stephen/files and /stephen/tmp and any files
    under them, but I want to clean up any files directly
    under /stephen that are over 10 days old. Here's the
    command that I've been working with:

    find /stephen -type d -prune -o -mtime +10 -exec rm
    -ef {}\;

    Can anyone tell me what I'm doing wrong?

    Thanks!

    -Stephen Spalding

    __________________________________
    Do you Yahoo!?
    Protect your identity with Yahoo! Mail AddressGuard
    http://antispam.yahoo.com/whatsnewfree


  • Next message: Mohamed Kamal: "Re: Help with the find command"

    Relevant Pages

    • RE: How to remove all *.tmp files
      ... Not sure if it would cleanup outlook attachments or word or excel temporary ... It sure leaves the cookies which are in use. ... give you the options to clean more than just tmp files for making more room. ... I thought at one time there was a command structure for the Delete ...
      (microsoft.public.windowsxp.perform_maintain)
    • Re: worm symptoms, and M-S patches wont "stick"
      ... > The command for WinXP is SFC.EXE ... and because after several cycles i found the system restore was NOT ... > | an immediate AVERT rerun was clean. ... > | then AVERT and then adaware were all clean. ...
      (microsoft.public.security.virus)
    • Re: Problem with Query Unload
      ... >> Thanks four your suggestion, Doug, but when I leave the End stmt out and ... Somewhere in your clean up code, ... > Private Sub Form_Unload ... start hitting F8 to single step each command. ...
      (microsoft.public.vb.general.discussion)
    • do loop with msg box
      ... Looking for a "neater coding" method using a Do Loop ... to substitute and clean up code that already works. ... The user clicks a command button to hide the subform. ...
      (microsoft.public.access.formscoding)
    • Re: "Loading" Xwindows from the command line
      ... On Fri, 26 Oct 2007, John Bradley wrote: ... In my enthusiasm to clean up my system and remove some "unwanted" software, ... There's data that I really need and can still see it using the command line, but I obviously need a GUI to access and use the data. ...
      (Fedora)