批量重命名和批量替换

Posted on Posted in bash

批量重命名文件夹下的所有文件

for i in `ls`; do mv -f $i `echo $i | sed 's/_太阳的后裔//';done`

批量替换某个文件夹下, 所有包含某文本的文件

grep -rl "字符串" . | xargs sed -i -e "s/字符串/替换/g"
» 转载请注明来源:呢喃 » 批量重命名和批量替换

Leave a Reply

Your email address will not be published. Required fields are marked *

nineteen + 2 =