LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remove files by time stamp (https://www.linuxquestions.org/questions/linux-newbie-8/remove-files-by-time-stamp-72904/)

evione 07-15-2003 08:47 AM

Remove files by time stamp
 
Hi,

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
Evione

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.