You can use the following code to remove files older than a certain date:
Replace /path/to/files with the directory you want to scan, and numdays with a number (files older than numdays ago will be deleted). For example to clear your temp directory and only keep files from the last 7 days you could use:
find /path/to/files/* -mtime +numdays -exec rm {} \;
Replace /path/to/files with the directory you want to scan, and numdays with a number (files older than numdays ago will be deleted). For example to clear your temp directory and only keep files from the last 7 days you could use:
find /tmp/* -mtime +7 -exec rm {} \;