转换文件名中空格为下划线
2011 年 11 月 30 日 转换文件名中空格为下划线无评论
#!/bin/bash
find . -name "* *" |
while read name; do
na=$(echo $name | tr ' ' '_')
mv "$name" $na
done
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
#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
发表评论