Answer the question
In order to leave comments, you need to log in
Centos clear folder contents, files by date?
Hello everyone, how to clear files in a folder by date, for example, there are three files,
1.tpl - 02/18/2017
2.tpl - 02/17/2017
3.tpl - 02/16/2017
How to clear a folder by cron, deleting files older than 1 day, that is, the date files on the 16th and 17th should be deleted.
Answer the question
In order to leave comments, you need to log in
find /path/to/folder/1 /path/to/folder/2 -type f -mtime +0 -delete
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question