Re: Help with the find command

From: Mohamed Kamal (mohamed.kamal_at_SPDC.COM.EG)
Date: 11/17/03

  • Next message: Othman, Asmah-Julaili SITI-ITDGP3-302: "Strange directory permission."
    Date:         Tue, 18 Nov 2003 00:33:51 +0200
    To: aix-l@Princeton.EDU
    
    

    Dear Stephen,

      you have to use the negation with the expression ( -type d ). So the command will be like that
    find /stephen ! -type d -prune -o -mtime +10 -exec rm -ef {}\;

    Best Regards
    Mohammed Kamal
    Systems Engineer

    -----Original Message-----
    From: Stephen Spalding [mailto:ssaixadm@YAHOO.COM]
    Sent: Mon, November 17, 2003 10:38 PM
    To: aix-l@Princeton.EDU
    Subject: Help with the find command

    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

    **********************************************************************
    This email and any files transmitted with it are confidential and
    intended solely for the use of the individual or entity to whom they
    are addressed. If you have received this email in error please notify
    the system manager.
    **********************************************************************


  • Next message: Othman, Asmah-Julaili SITI-ITDGP3-302: "Strange directory permission."

    Relevant Pages

    • 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)
    • Re: Reloading Alpha drivers, was: Re: Mouse: thumbwheel support
      ... modified to quiece the device and "clean up" (delete any dangling memory allocations, ... Plus the associated work in sys$load_driver and in the command line interface. ...
      (comp.os.vms)