天天看點

取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