find is the common tool for this kind of task :
find ./my_dir -mtime +10 -type f -delete
EXPLANATIONS
./my_diryour directory (replace with your own)-mtime +10older than 10 days-type fonly files-deleteno surprise. Remove it to test yourfindfilter before executing the whole command
And take care that ./my_dir exists to avoid bad surprises !