Quick and Dirty Sed Replace Command

Prodshot_170x190 Had to move my corporate kickstart server to a new vlan and re-ip it this past week. As a result I needed to update my kickstart config files so that they know where to look for the install media. Instead of editing each file directly I did the following to change the IP address in a kickstart config

sed -i ‘s/10.100.x.x/10.1.x.x/g’ centos5-u4_x86_64.cfg.

Once I saw that the command above worked as anticipated, I then ran the same command but on each cfg file in the directory. Syntax below

find . -type f -exec sed -i ‘s/10.100.x.x/10.1.x.x/g’ {} \;

Advertisements