Wednesday, April 10, 2013

linux grep and sed to find through files and replace a string

grep -rl oldstring path | xargs sed -i 's/oldstring/newstring/g

find /path -type f -exec sed -i 's/oldstring/newstring/g' {} \;

No comments:

Post a Comment