Last active
November 11, 2019 14:05
-
-
Save d4rckh/7a3fad85d7b7b944453042db34285727 to your computer and use it in GitHub Desktop.
interface info linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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