Any one of the following approaches can be used.

  1. Using find command, xargs and perl 1
     find . -type f | xargs perl -pi~ -e 's/SEARCHSTRING/REPLACESTRING/g;'
    

  2. Using find and sed 2
    find . -type f -exec sed -i 's/foo/bar/g' {} +
    

References:

  1. https://blogs.oracle.com/rammenon/recursively-replacing-a-string-in-all-files-in-a-directory-linux
  2. https://victoria.dev/blog/how-to-replace-a-string-in-a-dozen-old-blog-posts-with-one-sed-terminal-command