#!/bin/bash
# rename jpg and png
count=1
for img in *.jpg *.png
do
new=image-$count.${img#*.}
mv "$img" "$new" 2> /dev/null
if[ $? -eq 0 ];
then
echo "renaming $img to $new"
let count++
fi
done

 将文件名中有空格的文件名的空格全部替换为-

find path -type -f -exec rename 's/ /_/g' {} \;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2023-03-24
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2022-02-07
相关资源
相似解决方案