How to Find and Replace a String on the command line?
This command will replace all instances of ‘replaceme’ with ‘newstring’ in files ‘*.php’ on /home/mysite/httpdocs.
find /home/mysite/httpdocs -name '*.php' | xargs replace 'replaceme' 'newstring' --
Leave a comment