Delete files older than X days

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

This finds all files within that folder that are older than 14 days, then executes rm on them

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a comment