Skip to content

Instantly share code, notes, and snippets.

@cuongnv23
Created January 5, 2017 03:39
Show Gist options
  • Select an option

  • Save cuongnv23/dbb45f52a18449cd206e6bf55e56219f to your computer and use it in GitHub Desktop.

Select an option

Save cuongnv23/dbb45f52a18449cd206e6bf55e56219f to your computer and use it in GitHub Desktop.
speed script for tmux
#!/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