创建测试文件
cat > a.txt << END
docker
nl
sed
gearman
nlp
lua
rpm
END
删除3到5行
nl a.txt | sed '3,5d'
替换3到5行
nl a.txt | sed '3,5c lua'
...
shanhuhai
10年前 (2015-06-19) 2640℃
0喜欢
sed -i “s/原字符串/新字符串/g” $( grep 原字符串 -rl 目标目录 )
转载请注明:大后端 » Linux 批量替换文件内容...
shanhuhai
10年前 (2014-11-14) 2736℃
1喜欢