Help with the find command
From: Stephen Spalding (ssaixadm_at_YAHOO.COM)
Date: 11/17/03
- Previous message: Kilchenmann Timo: "Timo Kilchenmann, Bechtle Data AG ist abwesend."
- Next in thread: Mohamed Kamal: "Re: Help with the find command"
- Maybe reply: Mohamed Kamal: "Re: Help with the find command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Kilchenmann Timo: "Timo Kilchenmann, Bechtle Data AG ist abwesend."
- Next in thread: Mohamed Kamal: "Re: Help with the find command"
- Maybe reply: Mohamed Kamal: "Re: Help with the find command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|