I am in a situation where I have the /tmp directory having atleast 25,000 - 50,000 directories in it. I am trying to use the following command to delete the directories which are older than 2 days in that directory.
find /path/to/tmp/* -type d -ctime +2 -delete
But I keep running into the error that the argument list is too long. How can I specifically limit the number of directories being deleted? I tried using the maxdepth 1 option as well and that didn't seem to work.