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
时间: 2024-10-11 07:44:34