Mac:
$ ifconfig en0|awk -F"[ ]+" '/inet/{print $2}'
fe80::a211:9bff:fe15:2976%en0
192.168.0.100
Ubuntu:
$ ifconfig eth0|awk -F"[: ]+" '/inet addr/{print $4}'
192.168.0.100
$ ifconfig eth0|awk -F"[ ]+" '/inet6 addr/{print $4}'
fe80::20c:16ff:fe4c:3340/64
ubuntu新安装后无线网卡无法获取IP案例一则:http://www.linuxdiyf.com/linux/15588.html
Linux下自动获取IP地址:http://www.linuxdiyf.com/linux/8492.html
Ubuntu 11.04更新后无法动态获取ip:http://www.linuxdiyf.com/linux/5809.html