Help with the find command

From: Stephen Spalding (ssaixadm@YAHOO.COM)
Date: Mon Nov 17 2003 - 15:37:33 EST


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 archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:21 EDT