[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: a creative use of find

When I want to delete files within a dir older than a certain creation time, I use:
find /filesystem/location -ctime +30 -exec rm -f {} \;
this will delete files older than 30 day create time.


From: redhat-list-bounces redhat com on behalf of Bill Tangren
Sent: Fri 7/10/2005 10:56
To: General Red Hat Linux discussion list
Subject: a creative use of find

I am trying to delete all files in a directory that have creation dates
before September 16th. I have been trying to use the find command to do
this, but no luck so far. The best I have come up with is to try to copy
files newer than a particular file of that date, like this:

find . -newer file.name -exec cp -p ../dir \;

but this doesn't work. I have tried using -mtime, -atime, but no joy. I
can't find an option that uses the creation time, and applies it to
files that are OLDER than that time.

Any ideas?


Bill Tangren

redhat-list mailing list
unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]