Skip to content

Instantly share code, notes, and snippets.

@d4rckh
Last active November 11, 2019 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d4rckh/7a3fad85d7b7b944453042db34285727 to your computer and use it in GitHub Desktop.
Save d4rckh/7a3fad85d7b7b944453042db34285727 to your computer and use it in GitHub Desktop.
interface info linux
interface="enp3s0"
echo "Interface: $interface"
mac=$(eval "ifconfig enp3s0 | grep 'ether' | awk '{ print \$2 }'")
RX=$(eval "ifconfig $interface | grep 'RX packets' | awk '{ print \$6 }' | cut -d \"(\" -f 2")
TX=$(eval "ifconfig $interface | grep 'TX packets' | awk '{ print \$6 }' | cut -d \"(\" -f 2")
echo "RX: $RX MB"
echo "TX: $TX MB"
echo "MAC Address: $mac"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment