Linux getting all network interface names

前端 未结 6 1936
傲寒
傲寒 2020-12-01 08:30

I need to collect all the interface names, even the ones that aren\'t up at the moment. Like ifconfig -a.

getifaddrs() is iterating through

6条回答
  •  情深已故
    2020-12-01 08:56

    I thing this show you all interface, at least for me

    ip link show

    ls -1 /sys/class/net
    

    only show interface name

    lo
    p4p1
    

提交回复
热议问题