Skip to content

Instantly share code, notes, and snippets.

@jishanshaikh4
Created July 19, 2022 06:01
Show Gist options
  • Save jishanshaikh4/facb5763441abfb05172e2acd2ac4a70 to your computer and use it in GitHub Desktop.
Save jishanshaikh4/facb5763441abfb05172e2acd2ac4a70 to your computer and use it in GitHub Desktop.
Find thumbnails for a file in Linux (Solved: Set cache size of thumbnails in dconf-editor)
find_thumbnail(){
full_path="file://$(realpath -s "$1")"
md5name=$(printf %s "${full_path// /%20}" | md5sum)
find ~/.thumbnails/ ~/.cache/thumbnails/ -name "${md5name%% *}.png"
}
Usage:
======
find_thumbnail /path/to/file.bmp
find_thumbnail ~/Pictures/file.jpg
find_thumbnail file.jpg
find_thumbnail "file with spaces.tif"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment