[download]

local/bin/rename-hash

   1 #!/bin/bash
   2 
   3 md5sum "$@" | while read sum file; do
   4     dir=$(dirname "$file")/ dir=${dir#./}
   5     mv -vn "$file" "$dir${sum:0:6}.${file##*.}"
   6 done