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

ifconfig|sed -nr "2s/[^0-9]+([0-9.]+).*/1/p"
原文地址:https://www.cnblogs.com/qianyuezhan/p/13285520.html