Useful commands
Replace a string in several files
If you're on mac, make sure to use the GNU sed command (Mac OS ships with the BSD one). Install Fink and type sudo fink install sed. (Fink will also be useful in other occasions when you want to install other handy unix tools). Then run the following to do the actual string replacement (note that this will replace the content in the file directly, which is fine most of the time especially if you're using a version control system).
sed -i 's/string_to_replace/new_string/g' *
Add new comment