I help run a few web servers and one thing that bugs me is when you end up with all these Thumbs.db files hanging out. They’re harmless, of course, and they don’t take up much space (space is very cheap now a days) but still, let’s not load up sites with junk files please. So how do you do remove Thumbs.db files server wide? Simple:

find . -name Thumbs.db -print0 | xargs -0 rm

This of course runs it from whatever directory you’re currently in, so start at your /var/www/vhosts/ directory or wherever Apache has configured for website directories on your server.

You may want to first run the command without removing anything to see what it finds since I, at least, get pretty darn scared when running a remove command across a lot of files – one wrong command and poof! everything’s gone. So run this first on maybe one site:

find . -name Thumbs.db

Then run the real command when you’re ready.

This would be good to run a cron job for maybe once a week or once a month since people will be using FTP and these files will get uploaded along with contents of entire folders.


Another good idea is to set up a custom 404 page on WordPress.


Please enter your comment!
Please enter your name here