利用sed 取出ifconfig命令中本机的IPv4地址 Linux0403
1 [root@centos8 httpd]# 2 [root@centos8 httpd]# ifconfig ens33 | sed -n '/inet /s#\(.*inet \)\(.*\)\( n.*\)#\2#gp' 3 10.0.0.150

1 [root@centos8 httpd]# 2 [root@centos8 httpd]# ifconfig ens33 | sed -n '/inet /s#\(.*inet \)\(.*\)\( n.*\)#\2#gp' 3 10.0.0.150
