Arun Stephens

Replacing a domain name in WordPress with sed

I often need to do this, but always forget the syntax. So this is more for my reference than anybody else's:

sed 's/<OLD DOMAIN>/<NEW DOMAIN>/g' <INFILE>.sql > <OUTFILE>.sql  

It is just simple find and replace, so will also pick up domain names in email addresses, etc.