Thanx it works great when one wants to empty the .thumbnails directory regularly. If you want to see thumbnails the system needs to create them and afterwards you delete them. Unfortunately it's like fighting windmills. Much better would be to create smaller ones in jpeg when the occupied space is negligible. Or even better would be one file for a directory. Of course I am not a programmer or something so just looking for some settings to reduce the size.
I've just made a test by saving one of those thumbnails as jpeg and png. There's no big difference in quality but in size it is huge.
Maybe there is some copyright issue not to use JPEG but PNG.
Thanx anyway. This will do it till I found something better.
I wrote that script when I found over 9,000 thumbnail files in each of the .thumbnail sub directories, and had to remove them in blocks, because the number exceeded what could be removed with a single command. The limit was something like 4,000. They were using considerable space, in that quantity, and there were many many repeats of each, with nothing being removed at all, once created.
Having the tnails script allowed me to clean out the whole mess, before reaching the 4,000 item limit. While working with a lot of graphic files, the number of thumbnails generated, in short periods of time, led me to running tnails as a cron job. Opening a single directory with 500 - 1000 pictures would add that many thumbnails each time. Opening a series of directories in relatively quick succession led to the cron job running the script hourly.
Having the thumbnails is necessary when checking batches of pictures, but they breed like rabbits, and need population control.