I used the below command to delete files older than a year.
find /path/* -mtime +365 -exec rm -rf {} ;
But now I want to delete all files whose modified time is older than 01 Jan 2014. How do I do this in Linux?
This works for me:
find /path ! -newermt "YYYY-MM-DD HH:MM:SS" | xargs rm -rf
2.1m questions
2.1m answers
60 comments
57.0k users