ifconfig | grep -i ‘inet addr:‘ | awk ‘{print $2}‘ | awk -F : ‘{print $2}‘ | grep [^127.0.0.1]
linux获取本机ip
原文:http://www.cnblogs.com/sayaoailun/p/4729485.html