Tuesday 2 October 2012

Remove files older then X days on Linux

I always forget how i can clean up my /var/log. Therefor i dump the code snippet i need to do this. And it is so very simple...

Delete all files older then 3 days in current and child directories:
find . -mtime +3 -exec rm -rf {} \;

No comments: