Skip to content

Instantly share code, notes, and snippets.

@caramelchocolate
Created December 24, 2018 14:33
Show Gist options
  • Save caramelchocolate/49cd5930d8894ceabb76ef7fdf3595c8 to your computer and use it in GitHub Desktop.
Save caramelchocolate/49cd5930d8894ceabb76ef7fdf3595c8 to your computer and use it in GitHub Desktop.
This one-liner program renames files to md5 hash of any string.
find ./ -type f -print0 | while read -r -d '' file; do d=$(dirname "${file}"); mv -iv "${file}" "${d}/$(md5 -q ${file}).${file##*.}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment