I have been struggling with this one for quite a few days now. It seems simple enough but I cannot seem to find the right command or arguments needed to accomplish this (seemingly) simple task. I need to delete wildcarded files in a directory older than x days. I have tried the following to no avail and I am wondering if the wildcard is possibly the problem.
find /path/to/files/ -name file_* -mtime +45 -exec rm '{}' +
find /path/to/files/ -name file_* -mtime +45 -exec rm {} ;\
find /path/to/files/ -name file_* -mtime +45 | xargs rm
The find works fine, it lists the correct files. It's the deletion that is not working.