BASH: deleting files older than X number of days

find /path/to/folder -mtime +5 -exec rm -f {} \;

A handy utility to stick into the old brain. Thank you, internet, for providing me such a vast and available resource so that I know longer have to rely on my own faculty of memory.

Leave a Reply