October 11, 2008

Delete empty files, older than x days

Q: How do I delete files that older than a certain amount of days and which are empty

A: find . -empty -type f -mmtime +X| xargs rm or for those fancing exec, use find . -empty -type f -mmtime +X -exec rm {}

** X must be replaced with the number of days