阅读

文件批量改成md5名

shell  2021-10-28 23:27
#!/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