a creative use of find

Bill Tangren bjt at aa.usno.navy.mil
Thu Oct 6 21:56:59 UTC 2005


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?

TIA,

Bill Tangren




More information about the redhat-list mailing list