Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Show Ethernet drivers on Linux
br0 [ac:22:0b:c3:cd:2a]: (up)
docker0 [02:42:6b:bb:b4:67]: (down)
enp3s0 [ac:22:0b:c3:cd:2a]: r8169 (up)
enp5s0 [00:01:02:d8:91:07]: 3c59x (unknown)
enx00e04c6800e5 [00:e0:4c:68:00:e5]: r8152 (down)
lo [00:00:00:00:00:00]: (unknown)
vmnet1 [00:50:56:c0:00:01]: (unknown)
vmnet8 [00:50:56:c0:00:08]: (unknown)
# See:
# See:
for f in /sys/class/net/*; do
dev=$(basename "$f")
driver=$(readlink "$f/device/driver/module")
if [ "$driver" ]; then
driver=$(basename "$driver")
addr=$(cat "$f/address")
operstate=$(cat "$f/operstate")
printf "%16s [%s]: %10s (%s)\n" "$dev" "$addr" "$driver" "$operstate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment