#this deletes all files in /path/to/directory/ older than 7 days find /path/to/directory/ -type f -mtime +7 -execdir rm -- '{}' ;