Linux 中批量替換字符串

1.

 

 sed 命令  sed -i   "s/oldstring/newstring/g" `grep oldstring  -rl /path`

2.


perl  命令   perl -p  -i -e "s/oldstring/newstring/g" /path/*.html   /path/*.txt

3.


perl 命令  perl  -pi  -e  "s/oldstring/newstring/g"  `find   /path  type  -f`


發佈了7 篇原創文章 · 獲贊 0 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章