开发者

recursive SED in specific files

开发者 https://www.devze.com 2023-04-04 14:09 出处:网络
I want t开发者_如何学Pythono change each pattern \"evictions\" with \"128\" in all files started with \"tor*\". I use

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

精彩评论

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

关注公众号