shell获取ip

ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"
原文地址:https://www.cnblogs.com/sayaoailun/p/5279501.html