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" {} \;
精彩评论