Command-line tip: replace a word in all files in a directory
I need to use this command every once in awhile and I always forget how to do it off the top of my head.
grep -lr --exclude-dir=".git" -e "oldword" . | xargs sed -i '' -e 's/oldword/newword/g'
If you're on Windows you'll need unix command-line tools installed. The easiest way to do that is with Gow.
Here's what each piece does: