替换内容 sed
sed- 全局替换字符串
sed -i 's/oldstring/newstring/g' $filename- 执行前一定要做好备份
- 【备注】对于MacOS,这条命令执行不了,要修改为下面的
sed -i '' 's/oldstring/newstring/g' $filename
- 全局替换字符串
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
sed
sed -i 's/oldstring/newstring/g' $filename
sed -i '' 's/oldstring/newstring/g' $filename