Replace string in all files using sed in linux
Replaces all “OLDSTRING” to “NEWSTRING” in all files
1 |
$ grep -rl OLDSTRING * | sort | uniq | xargs sed -i -e ‘s/OLDSTRING/NEWSTRING/’ |
or using find:
1 |
find */public_html/ -iname '*.php' -exec sed -i -e 's/OLDSTRING/NEWSTRING/' {} \; |