Deleting files older than a given date

Hi all,

I want to delete all files in a directory which are older than a given date.

I thought of doing it by creating a file by the required date by using touch command. And then i would use find command on that file and try to find files older than that.

I searched the man and found a newer option for find command.
But i didn't get the opposite of it (i would like to find older files)

Can anyone please tell me the easiest way to do that?

Thanks in advance,
raju

Read your "find" man page carefully and see if "-mtime +3" is the opposite of "-mtime -3". It is in some newer versions of find, and you may have one.

This is a case where posting the result of "uname -sr" or something similar would allow those with specialized knowledge to help more.

you could use the find command

eg

find /my_current_directory -mtime +5 -exec rm {} \;

Note
To find files created more than 5 days use -mtime +5
To find files created less than 5 days use -mtime -5

If there are a lot of these files, you'll save time with

find /my_current_directory -mtime +5 -print | xargs rm 

I.e., invoke "rm" on large groups of files --- frequently only once.