Linux命令vim下的全局替换 :%s/network/666666/g 这代表把这个文件中所有network替换为666666

[root@k8s-master01 ~]# ls
anaconda-ks.cfg kubernetes

[root@k8s-master01 ~]# vim anaconda-ks.cfg 
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=cn --xlayouts='cn'
# System language
lang zh_CN.UTF-8

# Network information
network  --bootproto=dhcp --device=ens33 --ipv6=auto --activate
network  --hostname=localhost.localdomain

# Root password
rootpw --iscrypted $6$oGXcfgPnshVaE2oP$CgX3Xa0vSe0YKhiFnp9wrXGmsQi6xOPsIX4EG.wqzfYNaAWYyt6FauOehyg9bmmo1JWuEGOtnflmvT68flmab0
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai --isUtc
# System bootloader configuration
~                                                                                                                                                                      
~                                                                                                                                                                      
~                                                                                                                                                                      
"anaconda-ks.cfg" 26L, 735C  

:%s/network/666666/g 这代表把这个文件中所有network替换为666666

你可能感兴趣的:(linux,linux,运维,服务器)