-   Linux - Newbie (
-   -   Remove files by time stamp (

evione 07-15-2003 08:47 AM

Remove files by time stamp

I would like to know if it is possible to use the rm command to remove files judging by the time they were created.

Hope someone can help me.

Many thanks

bentz 07-15-2003 09:35 AM

You can do this, but there are several different ways depending on the timestamp criteria you are concerned with. For example, find has several different ways to compare whether or not a file has been modified in 'n' minutes or whether a file has been modified since another file. Using 'date', 'ls', and 'awk' you can use just about any date criteria to conditionally rm certain files. If you want to rotate logs, use the logrotate.d service, which is cron based.

Can you give a specific example of what timestamp criteria you are looking to examine?

All times are GMT -5. The time now is 11:15 AM.