After a bit of googling / research on my own i haven't found a definitive answer,
I'm looking to search the entire /var/www/html/ folder for occurances of "127.0.0.1" and replace them with a server IP address (we're moving the database off of the local box).
This goes for Localhost & 127.0.0.1. While i could just run
find * | xargs sed -i a/127.0.0.1/ser.ver.ip.addr/g
twice, once replacing 127.0.0.1 and localhost, i'd rather not have to run two commands.
Am i able to do a OR statement without it breaking?
Something like:
find * | xargs sed -i a/127.0.0.1|localhost/ser.ver.ip.addr/g
----------------------------edit----------------------
I found a slightly more reliable method of doing a search & replace,
find * -type f -exec sed -i 's/127.0.0.1/ser.ver.ip.addr/g' {} \;
However i can't seem to get the search statement to match 127.0.0.1 OR localhost.
I think you would have to put it in quotes: