利用sed 取出ifconfig命令中本机的IPv4地址

ifconfig|sed -nr "2s/[^0-9]+([0-9.]+).*/\1/p"

 

posted @ 2020-07-11 21:18  树在地上  阅读(409)  评论(0编辑  收藏  举报