常用例子
- -r 正则
- -i 修改文件
sed -ri 's/^ServerActive.*/ServerActive=zbx.cds/' zabbix_agentd.conf | grep Server
sed -ri 's/^Hostname.*/Hostname=CrawlAutoSync18/' zabbix_agentd.conf | grep Host
sed -ri 's/^Server=.*/Server=zbx.cds/' zabbix_agentd.conf | grep Server
网友评论