天天看点

取IP地址

ifconfig eth0 |grep "inet addr:" |awk '{print $2}'|cut -c 6-   

或者

ifconfig   | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

 本文转自 技术花妞妞 51CTO博客,原文链接:http://blog.51cto.com/xiaogongju/1951804