利用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 

 

posted @ 2021-11-15 02:04  丁丁在线  阅读(134)  评论(0)    收藏  举报