1

I messed up with the thumbnails folder, now those thumbnail pictures are all over the place.

How can I find all of the thumbnail pictures and delete them? Do they have a specific size? Or naming pattern?

1

How can I find all of the thumbnail pictures and delete them? Do they have a specific size? Or naming pattern?

They do not have a specific size but they do have a somewhat** specific naming pattern in that they are .png files with 32-character long prefixes. The prefixes contain only lower case numbers and letters:

~/.cache/thumbnails/normal $ ls -l
total 976
-rw-rw-r-- 1 dkb dkb  5306 Dec 18 19:09 085c000fbbf0acf30a6cd10fba7840b6.png
-rw-rw-r-- 1 dkb dkb 17064 Dec 18 19:10 096f43aca7514b077af55837fa2e991f.png
-rw-rw-r-- 1 dkb dkb  1007 Jan  7 14:04 0dea5b174496fdc296eeab1c16d14890.png
-rw-rw-r-- 1 dkb dkb  1609 Dec 18 19:10 0f61d62142d309ac7217c2db97f461f7.png

**I found files fitting the naming pattern even in my ~/.config/google-chrome subfolders.

The prefix of this type matches the string generated using md5sum. For example,

echo -n "file:///home/dkb/Pictures/mogrify.png" | md5sum 5c876891579e1ddb68858fcd1285fa3e  -

That said, you can list these files and their locations with

find ~ -iname "*.png" -ls | grep -E "[[:alnum:]]{32}.png"

Given that there's no guarantee that only thumbnails will be recovered by the command, you'll need to use your judgement in deleting these files.

~ $ find ~ -iname "*.png" -ls | grep -E "[[:alnum:]]{32}.png"
   263512      4 -rw-------   1 dkb    dkb          68 Dec 19 18:47 /home/dkb/.config/google-chrome/Default/Extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm/1.17.4_0/web_accessible_resources/c77d1c55bb336440de0677e841870dd2.png
   263514      4 -rw-------   1 dkb    dkb          83 Dec 19 18:47 /home/dkb/.config/google-chrome/Default/Extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm/1.17.4_0/web_accessible_resources/70a7e8510b6031f0d7d6dbf4a6e70c3e.png
   263513      4 -rw-------   1 dkb    dkb          68 Dec 19 18:47 /home/dkb/.config/google-chrome/Default/Extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm/1.17.4_0/web_accessible_resources/08bccca4f0b22bca18001da690ef0f6b.png
  4992634    104 -rw-rw-r--   1 dkb    dkb      105801 Dec 31 19:12 /home/dkb/.cache/thumbnails/large/50300a09e33e5f5708ff995ce8780bf0.png
  4982659     44 -rw-rw-r--   1 dkb    dkb       43937 Dec 19 14:13 /home/dkb/.cache/thumbnails/large/e0f35cdc15dfa67a127d63b02be6198b.png
  4981212      8 -rw-rw-r--   1 dkb    dkb        7467 Dec 18 19:10 /home/dkb/.cache/thumbnails/normal/7254f83b68182514fc7da15bc055e11b.png
  4981237      4 -rw-rw-r--   1 dkb    dkb         134 Dec 18 19:10 /home/dkb/.cache/thumbnails/normal/4bfa9f4ef307e8662c6e3575272b0176.png
...
  • 1
    I think those prefixes are just some hexadecimal strings (corresponding to filename hashes?). – pomsky Jan 10 at 21:03
  • 1
    Thanks! Looks like md5sums based on the file's URL. – DK Bose Jan 11 at 2:00
  • This seems not to be valid always. I have on my NFS share a folder named .@__thumb/: .@__thumb/default106.jpg. – kerner1000 Jan 11 at 10:00
  • Do you know how those files were generated? The system doesn't create .jpg thumbnails. – DK Bose Jan 11 at 10:04
  • 1
    hm, the files lie on a QNAP NAS. Maybe some QNAP app created thumbnails as well.. – kerner1000 Jan 11 at 11:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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