Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

recursive SED in specific files

I want to 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.

like image 992
mahmood Avatar asked Sep 11 '11 05:09

mahmood


1 Answers

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

Do this:

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

like image 190
beatgammit Avatar answered Jan 03 '23 07:01

beatgammit