Any one of the following approaches can be used.
- Using find command, xargs and perl 1
find . -type f | xargs perl -pi~ -e 's/SEARCHSTRING/REPLACESTRING/g;'
- Using find and sed 2
find . -type f -exec sed -i 's/foo/bar/g' {} +
References:
- https://blogs.oracle.com/rammenon/recursively-replacing-a-string-in-all-files-in-a-directory-linux
- https://victoria.dev/blog/how-to-replace-a-string-in-a-dozen-old-blog-posts-with-one-sed-terminal-command