If you're using find to identify the files, something like the following might do the job:
Code:
find /tmp -type f -mtime +2 -exec rm -f {} \;
Or to avoid recursing the directories
Code:
find /tmp -type f -maxdepth 1 -mtime +2 -exec rm -f {} \;
Unless you're completely certain that no false positives can occur I'd suggest a trial run first:
Code:
find /tmp -type f -mtime +2 -exec ls -l {} \; > ~/trial-run.log
Or to avoid recursing the directories
Code:
find /tmp -type f -maxdepth 1 -mtime +2 -exec ls -l {} \; > ~/trial-run.log