开发者

How do I do a recursive, in-file replace?

开发者 https://www.devze.com 2023-02-20 00:21 出处:网络
Let\'s say 开发者_JS百科I want to scan through every file in this directory (recursive, too). And I want to replace happy.magic with sad.apps.magic

Let's say 开发者_JS百科I want to scan through every file in this directory (recursive, too).

And I want to replace happy.magic with sad.apps.magic

How can I do that?


find . -type f -exec sed -i 's,happy.magic,sad.apps.magic,g' {} \;


Eric is right, but just to be clear:

find ./ -type f -exec sed -i "s/happy\.magic/sad\.apps\.magic/g" {} \;
0

精彩评论

暂无评论...
验证码 换一张
取 消