Am I Calvin, or Hobbes?
Batch Find and Replace with the Linux Command Line
Two simple, rather elegant, solutions:
perl -pi -w -e ‘s/wrong/right/g;’ *.html
Replaces all instances of ‘wrong’ with ‘right’ in html files within the current working directory.
grep -rl “wrong” /home/jerrywaller | xargs sed -i ‘s|wrong|right|g’
Recursively replaces ‘wrong’ with ‘right’ within the designated directory.
Just make sure you use plain single and double quotation marks, and not the smart quotes that may show up in the formatting above. Hat tip to the author and commenters here and here. Now both options are in one convenient location. ;)