/sbin/ifconfig | grep -i "inet" | grep -iv "inet6" | awk {'print $2'} | sed -ne 's/addr\://p' 转载于:https://my.oschina.net/feedao/blog/158128