开发者

recursive SED in specific files

I want t开发者_如何学Pythono change each pattern "evictions" with "128" in all files started with "tor*". I use

find . -name "tor*" -exec sed "s/evictions/128/g" '{}' \;

But it doesn't work.


You need the -i flag, which edits files in place.

Do this:

find . -name "tor*" -exec sed -i "s/evictions/128/g" '{}' \;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜