Search and replace on a large file on OSX using Sed

This post was written 3 years ago.
Thu, 06 Mar 2014
My code editor of choice, Sublime text 2, crashes when you try to do a search and replace on a large file. This makes it difficult to do a search and replace on a large sql file, as I sometimes need to do when moving a wordpress site from one domain to another

The command-line tool sed can be used instead like this:-

sed -i '.backup' 's/olddomain/newdomain/g' wordpress-backup.sql
This makes a backup of the original file, then updates the original
Tags: wordpress / osx /