If you use Linux along with another operating system such as Windows or Mac OS X, then you’re familiar with the idea of transferring files to Linux from the other OS, only to find you’ve managed to bring along “extra” files that serve no purpose. Common examples of those “extra” files are Thumbs.db, Desktop.ini, and .DS_Store, along with many others. What are those files?
Well, the Thumbs.db file is how Windows stores image thumbnails, to make browsing through a large directory of files quicker. On Linux, however, it’s useless. The .DS_Store file from Mac OS X is a Desktop Service Store and has a similar purpose. It keeps track of where icons are positioned, and if the user has chosen a custom background image. Finally, the Desktop.ini file (another one from Windows), is similar to the .DS_Store file in that it keeps track of customized folder. Once again, useless on Linux.
Thankfully none of these files takes up space, but frankly that’s all they do on Linux: take up space. You can, of course, delete them or send them to the trash, but that’s only temporary. The next time that folder is loaded up in Windows or Mac OS X, a new file is created.
Thankfully, at least for Thumbs.db files, there is a solution. It won’t keep Windows from creating the files in the first place, but once this handy utility is installed, every time you browse to a folder that contains a Thumbs.db, that file is instantly deleted.
Called Nautilus Extension Kill Thumbs, the point of the extension should be painfully obvious! So how do you use it? Well, beyond installing it, there’s not a lot to do. Simply grab the installer from its page at gtk-apps.org and you’re almost done! There are packages available for 32bit and 64bit Ubuntu, as well as Arch Linux. And if you’re on any other distro, a source package is available as well. Installing Nautilus Extension Kill Thumbs from source is simple: “sudo make install”(without the quotes), from inside the source directory should do it.
Once installed, Nautilus Extension Kill Thumbs works without any input from you the user. Find a folder with a Thumbs.db file in it, navigate to it and “poof,” it’s gone!
One tip, however: even before you begin, enter this bash command into the Terminal:
for i in $(find . -name thumbs.db); do rm -fr $i; done
Doing so will scour your entire system for Thumbs.db files and completely remove them. The advantage is that they’re all gone. Sure, Windows may add another one the next time you boot into it, but with this command, coupled with the Nautilus Extension Kill Thumbs utility, they should never appear again. With only the Nautilus Extension Kill Thumbs, you’ll get every Thumbs.db file you “see” (even if the utility zaps it almost instantly), but if you never visit a folder containing a file, it will never get deleted. The above command takes care of all that.
I love this utility. It’s a simple, one-trick pony, yet it really highlights the power of scripting. With just a few lines of text, an annoyance is rid from your system. It does one thing, but does it incredibly well. Now if the author (or someone… anyone!), would just write something similar for Desktop.ini and .DS_Store files, I’d be a happy camper.