[root@192 cfg]# find /home/neople/ -name '*.cfg' -exec sed -i s/120.245.78.72/192.168.117.231/g {} \;
/home/neople/ #要替换的目录
*.cfg #以.cfg结尾的配置文件
s/120.245.78.72/192.168.117.231/g #你要替换的IP
[root@192 cfg]# find /home/neople/ -name '*.cfg' -exec sed -i s/120.245.78.72/192.168.117.231/g {} \;
/home/neople/ #要替换的目录
*.cfg #以.cfg结尾的配置文件
s/120.245.78.72/192.168.117.231/g #你要替换的IP
发表评论