如何在 Linux 搜尋目錄下包含某字串的檔案,並將字串替換為其他字串?
六月 21st, 2007 | 2,416 Views |
這也是一個常常用到的功能….方法如下:
find ./ -type f -exec sed -i ’s/string1/string2/’ {} \;
string1 是要找的字串,string2 是要替換成的字串。

The 如何在 Linux 搜尋目錄下包含某字串的檔案,並將字串替換為其他字串? by 連小峰, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Taiwan License.
