Remove all the files in a directory with a specific name

I have a web app that generates temporary files as part of a shell script. The files start with ‘frequency’ and have a hash appended. Sometimes the app doesn’t clear them out. This line does it. At some point I need to put this in a cron job, but I haven’t done it yet.


sudo find /tmp -iname "frequency*" -exec rm -f {} \;

By the way, I think the reason that the files are not cleared out is that they are generated by SpamBots. The code for clearing temporary files is on the display page. It never executes because the page that displays the results is never loaded.