Skip to content

Instantly share code, notes, and snippets.

@epixoip

epixoip/lsnethw.sh

Created May 20, 2020
Embed
What would you like to do?
#!/bin/sh
for i in /sys/class/net/*; do
printf "%-10s Driver: %-10s State: %s\n" \
"$(basename $i)" \
"$(sed -rn 's/DRIVER=(.*)/\1/p' $i/device/uevent 2>/dev/null || echo unknown)" \
"$(cat $i/operstate)"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment