我想grep或需要哪个以太网接口“ en”正在获取inet ip的结果。 另外,在以下ifconfig在终端结果en6越来越INET 192.188.10.111所以结果应该是EN6。
示例:如果en2或en5或任何en XxX正在获取inet IP ID,则应显示以太网接口enno。
它不应显示lo0回lo0 inet 127.0.0.1
MY_MAC:~ SKULL$ ifconfig
lo0: flags=8049 mtu 16384
options=3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1
gif0: flags=8010 mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8823 mtu 1500
ether 83:c1:9y:z0:g9:99
nd6 options=1
media: autoselect ()
status: inactive
en1: flags=8963 mtu 1500
options=60
ether 99:85:40:69:05:z0
media: autoselect
status: inactive
en2: flags=8963 mtu 1500
options=60
ether 99:84:43:67:43:b6
media: autoselect
status: inactive
p2p0: flags=8802 mtu 2304
ether 09:k5:6m:s6:q1:78
media: autoselect
status: inactive
awdl0: flags=8902 mtu 1452
ether w1:6t:c3:w2:n4:78
nd6 options=1
media: autoselect
status: inactive
bridge0: flags=8863 mtu 1500
options=63
ether 23:j5:12:43:43:67
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1
media:
status: inactive
en6: flags=8863 mtu 1500
inet6 fe80::2e0:4cff:fe36:550%en6 prefixlen 64 scopeid 0xb
inet 192.188.10.111 netmask 0xffffff00 broadcast 192.168.255.255
nd6 options=1
media: autoselect (100baseTX )
status: active