Created
January 5, 2017 03:39
-
-
Save cuongnv23/dbb45f52a18449cd206e6bf55e56219f to your computer and use it in GitHub Desktop.
speed script for tmux
This file contains hidden or 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
| #!/bin/bash | |
| iface=$1 | |
| RXB=$(</sys/class/net/"$iface"/statistics/rx_bytes) | |
| TXB=$(</sys/class/net/"$iface"/statistics/tx_bytes) | |
| sleep 1 | |
| RXBN=$(</sys/class/net/"$iface"/statistics/rx_bytes) | |
| TXBN=$(</sys/class/net/"$iface"/statistics/tx_bytes) | |
| RXDIF=$(echo $((RXBN - RXB)) ) | |
| TXDIF=$(echo $((TXBN - TXB)) ) | |
| echo -e "d: $((RXDIF / 1024 / 2))K/s u: $((TXDIF / 1024 / 2))K/s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment