主页 > 仅仅转载 > 转换文件名中空格为下划线

转换文件名中空格为下划线

#!/bin/bash  
find . -name "* *" |  
while read name; do  
    na=$(echo $name | tr ' ' '_')  
    mv "$name" $na  
done
#!/bin/bash  
#Replace all spaces in the files in current directory and subfolder with  
#underline.  
for x in `ls -R`; do mv "$x" `echo -n $x | tr " " "_"`; done

原文地址 http://blog.csdn.net/qazplm12_3/article/details/565093

发表评论

邮箱地址不会被公开。 必填项已用*标注