Operating System - Linux
1821800 Members
3018 Online
109637 Solutions
New Discussion юеВ

Delete/Move files based on date

 
Tonatiuh
Super Advisor

Delete/Move files based on date

Red Hat Enterprise Linux

How can I delete all files older than certain date?
2 REPLIES 2
Ivan Ferreira
Honored Contributor

Re: Delete/Move files based on date

To find files older than 30 days use:

find /path -type f -mtime +30 -exec rm {} \;

To find based on a specific date, James Ferguson has an exelent example here:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1048222
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Tonatiuh
Super Advisor

Re: Delete/Move files based on date

Ivan, I think I must change de "-mtime" by anny timestamp value, but I do not know the syntax of this value, could you help with some examples?