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