Shell 批量替换目录下所有文件+批量插入

Shell 批量替换目录下所有文件

# 替换 mulu 下所有文件,src="" 换成 src="1.png"
sed -i 's/src=""/src="1.png"/g' `grep src="" -rl mulu`
# 替换index.html,src="" 换成 src="1.png"
sed -i 's/src=""/src="1.png"/g' index.html
# apk 替换
grep -i "windows" -r ./path | awk -F : '{print $1}' | sort | uniq | xargs sed -i 's/windows/linux/g'  
# find 查找替换
find -name '111.html' | xargs perl -pi -e 's|Windows|linux|g'
grep "#DENY FILES" -r .|cut -d ":" -f1 |xargs -n1 -i sed -i '/#DENY FILES/ i    IncludeOptional /www/server/panel/vhost/apache/config.conf' {}
# Shell   批量替换   Script  

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×