0

I have a set of nested folders which I transferred from Window 10 to a Linux PC. Without realizing it I also transferred the "Thumbs.db" entries. I say "entries" because when I do a "ls" command on one of the folders, it will show the .jpg files, other folders and also the "Thumbs.db" entry, but it is not colored/highlighted like the files nor the folders. Shows the Thumbs.db entry in a screen shot

I can remove the Thumbs.db entry with a rm images/folder/Thumbs.db command, but that seems to be a manual/one-at-a-time operation. "find" does not find them find images/ -name "Thumbs.db" either with or without the double-quotes. Also running with sudo has no effect.

Is there a easy way to get rid of these Thumbs.db entries? Thanks...RDK

2
  • 2
    find should be able to "find" them. find /path/to/images/ -name "Thumbs.db" -delete should work just fine.
    – pLumo
    Mar 15 at 13:56
  • What type of filesystem do you use on your Linux machine? Is it one that is case-insensitive?
    – Kusalananda
    Mar 17 at 10:01

2 Answers 2

0

Your shell can do "globbing", automatic creation of file names from wildcards.

A simple

rm images/*/Thumbs.db

will delete all the Thumbs.db from direct subfolders of images, so images/a/Thumbs.db, images/wedding/Thumbs.db, images/boat/Thumbs.db…;

Assuming you use bash (which is the default shell on most systems), you can also enable recursive wildcards

shopt -s globstar
rm images/**/Thumbs.db

will go into all subdirectories, and subdirectories, and subdirectories… and delete all Thumbs.db.

But if find doesn't find them, chances are they aren't actually called Thumbs.db. We can try whether it's because capitalization is different:

shopt -s globstar
shopt -s nocaseglob
rm images/**/Thumbs.db

will also delete any thumbs.db, THUMBS.dB, tHumbs.DB…

1
  • I have updated my question with a screen shot showing the "Thumbs.db" entry in a folder list. As I said above I can remove it using a RM command, but FIND does not find the files.
    – RDK
    Mar 17 at 8:33
0

After an additional web search, I found this command with finds the Thumbs.db entries so they can be deleted. "iname" seems to be the key option:

find images/folder/ -iname Thumbs.db

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.