How does one get ip addr show
to only show links of a specific type, without using a secondary process like grep to do filtering?
According to man 8 ip-address, this should be possible using the following, but when I run these, I get no results:
ip addr show type "link/loopback"
ip addr show type "loopback"
TYPE := [ bridge | bridge_slave | bond | bond_slave | can | dummy | hsr | ifb | ipoib | macvlan | macvtap | vcan | veth | vlan | vxlan | ip6tnl | ipip | sit | gre | gretap | erspan | ip6gre | ip6gretap | ip6erspan | vti | vrf | nlmon | ipvlan | lowpan | geneve | macsec ]
loopback
orether
. That's disappointing.lo
and filter on IFNAME instead, soip addr show lo
will work. Not sure if it is relevant for your use though.link/ether
,link/loopback
, etc. lines, instead of filtering an interface.