obsidian-images-to-md5-hashes
Renames randomly-named images in your Obsidian vault to the MD5 hash of the image itself (also updates the markdown files themselves). See https://forum.obsidian.md/t/rename-images-from-screen-shot-xxxx-to-its-md5-hash/17141
Setup
- Download the script
chmod +x obsidian-images-to-md5-hashes.sh- copy or move it to somewhere in your
$PATH
Usage
obsidian-images-to-md5-hashes.sh </path/to/vault/> <name-of-attachment-dir>e.g.
obsidian-images-to-md5-hashes.sh "/Users/luke/Documents/My Vault2/" attachThis is somewhat inefficient, but it does work. May take 5 minutes or more to process a large vault. Really depends on how many images you have in your attachdir.
When complete, backups of the original filenames and markdown files will be put in a timestamped "backup-XXXXXXXXXX" folder within the vault dir.
N.B. All images/links will be consolidated into the single attachment folder. The path prefix will be stripped, so links such as ![[attach/foo.png]] will be converted to ![[hash.png]].
