ifconfig |grep inet |awk -F: 'NR==1{print}' |awk '{print $2}' 转载于:https://www.cnblogs.com/leon2659/p/10202189.html