# 显示所有网络接口信息
ifconfig
# 仅显示IP地址和MAC地址
ifconfig | grep -E "inet\s|ether"
ifconfig 命令:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
ether a1:b2:c3:d4:e5:f6
ifconfig | grep -E “inet\s|ether” 命令:
inet 127.0.0.1 netmask 0xff000000
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
ether a1:b2:c3:d4:e5:f6