linux 以太网 mac,linux - 如何在Mac Shell脚本中从inet ip查找/ grep以太网接口(en) - 堆栈内存溢出...

我想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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值