Remove Files Older than X days

Remove File older than 30 days:
find /path_to_file/ * -mtime +30 -exec rm {} \; 

Remove File older than 7 days:
find /path_to_file/ * -mtime +7 -exec rm {} \; 

Remove Specific file type older than 7 days:
find *.xml -mtime +7 -exec rm {} \;
Comments