Sunday, July 28, 2019

How to replace a string in multiple files in linux from command line


find ./ -type f -exec sed -i 's/string1/string2/g' {} \;

For global case insensitive:
find ./ -type f -exec sed -i 's/string1/string2/gI' {} \;

No comments:

Post a Comment