linux神奇的sed命令

sed -i "s/nameserver * /#nameserver /"  /etc/resolv.conf

sed -i "s/#nameserver * /nameserver /"  /etc/resolv.conf

 

[root@active ~]# cat /etc/resolv.conf
#nameserver 61.134.1.5
#nameserver 8.8.8.8
#nameserver 8.8.4.4
#nameserver baidu.com
#nameserver 221.11.5.39
#nameserver 61.134.1.4

你可能感兴趣的:(linux神奇的sed命令)