Sometimes, my scripts get trapped in infinite loops. When the loop creates new files, things get messy.
I currently have this file name format:
4883 is a counter.
I need to delete all files, except the first 10 (i.e. counter in 0-9, inclusive). Currently, around 10k files are created before I can react and stop the script. SSD's are really fast.
It gets a bit harder by
rm not accepting that many arguments:
-bash: /bin/rm: Argument list too long
Oh, and I'm currently on a mac.