How Do I Find And Delete Files Of A Certain Type?

How Do I Find And Delete Files Of A Certain Type?

Dear Lifehacker,A program created data files for every song in my collection. No problem, right? Except my music is spread across nested folders on multiple drives. Know a program that bulk-deletes certain file types? Sincerely,

Dear ScatteredTunes,

Depending on which system you’re using, it’s either a few clicks, a (very) small software download, or a tiny bit of command line jujitsu to chop out a certain perfunctory file type across all your storage.


Windows Vista (and XP with the optional Windows Search 4.0 installed) offer a bit more built-in power. Hit the search option from the Start menu, toggle the Advanced Search option from the right-hand corner, and use the drop-down fields to narrow your search:

On a Mac, Spotlight has you covered. Gina covered a system-wide search and delete mission in her own Ask Lifehacker response, which also involved a wonky, folder-clogging file (what’s up, thumbs.db!).

We’re kind of doubtful you’re a Linux user stricken with a proprietary, file-dropping program. Still, on the off chance you wanted to kill those files open-source style, crack open the terminal and type in this command:

find ./ -iname *.PITA

See your files there? If not, and you’ve got them stashed on a NTFS partition you’ve mounted in Linux, you might have to get specific. In my case, for instance, I’d type:

find /media/win7/ -iname *.PITA

Now, if it looks like everything’s been found, and nothing unintentional targeted, add a little bit onto the end:

find ./ -iname *.PITA -exec rm {} ;

Need to get a bit more in-depth and particular? Try this handy guide to the find command.

Peace, soul, and good hunting,


Log in to comment on this story!