标签:
#!/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‘ {} \;
标签:
原文地址:http://www.cnblogs.com/guochunyi/p/5803209.html