开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜