How to do a recursive find/replace of a string with awk or sed?

后端 未结 30 1614
盖世英雄少女心
盖世英雄少女心 2020-11-22 06:39

How do I find and replace every occurrence of:

subdomainA.example.com

with

subdomainB.example.com

in eve

30条回答
  •  粉色の甜心
    2020-11-22 07:33

    just to avoid to change also

    • NearlysubdomainA.example.com
    • subdomainA.example.comp.other

    but still

    • subdomainA.example.com.IsIt.good

    (maybe not good in the idea behind domain root)

    find /home/www/ -type f -exec sed -i 's/\bsubdomainA\.example\.com\b/\1subdomainB.example.com\2/g' {} \;
    

提交回复
热议问题