[HowTo] Replace ip address using sed

[HowTo] Replace ip address using sed

June 20, 2011

Following one-liner will search for a ip address pattern in the specified file and replace it with the one provided :

sed 's/[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}/**IPADDRESS-COMES-HERE**/g' /SourceFilename > /DestinationFilename