文件批量改成md5名
#!/bin/sh for file in `ls ./` do md5=`md5sum ${file}` echo ${file} name=${md5:0:32} if [[ "${file}" != "rename.sh" ]] && [[ ! -f "${name}.txt" ]]; then echo "${name}" mv "${file}" "${name}.txt" fi done
#!/bin/sh for file in `ls ./` do md5=`md5sum ${file}` echo ${file} name=${md5:0:32} if [[ "${file}" != "rename.sh" ]] && [[ ! -f "${name}.txt" ]]; then echo "${name}" mv "${file}" "${name}.txt" fi done