System Speed Testing
For general speed tests of your connection from the command line, install the “speedtest-cli” python package via “pip”:
pip install speedtest-cli
Then simply run “speedtest-cli” from the command line.
Current Download Speeds
Because download speeds are a function of several factors, including the quality of your internet uplink, the speed of your local card and network, as well as the server at the other end of the connection, it can be useful to know how well current file transfer operations are performing.
There are several options for doing this. One option is to use an off-the-shelf tool like “iftop”
yum install iftop iftop
Another way is to observe the change in bytes received or transmitted by looking at “/proc/net/dev”. You will need to know the name of the interface you’re interested in, but for most people that will be just one, and looking at /proc/net/dev should make it obvious the name of the active port. You can also run “ifconfig” to obtain this information. Output from:
Looks something like this:
eno2: 746899204542 1020519735 0 427480 238 0 0 82978570 1964007160840 1389285911
A bit messy for presentation, but the most relevant columns consist of the interface name followed by the bytes received. Look further down the row for the bytes transmitted.
By looking at the change in this file over time, you can determine the rate of received or transmitted bits in real time. It is easiest to create a little script that will do that for you. Here’s mine:
#Computes download rate in MBs and Mbs for given interface
#March 7, 2019
#Last Modified: 03/07/2019
echo "Usage: $0 -i interface-name [-h]"
file= verbose= quiet= long=
while [ $# -gt 0 ]
case $1 in
echo $0: $1: unrecognized option >&2
echo "run ./downreceive.sh -h for usage" >&2
if [[ -z $INTERFACE ]]
echo "You must provide the interface name. Run ifconfig if needed."
eth=($(cat /proc/net/dev | grep $INTERFACE))
if [[ -z $eth ]]
echo "Interface provided is not valid"
receive1=($(cat /proc/net/dev | grep eno2 | cut -d " " -f 4))
receive2=($(cat /proc/net/dev | grep eno2 | cut -d " " -f 4))
echo "scale=2; (($receive2-$receive1) /2.0) * 0.000001" | bc -l
echo "scale=2; $rateMBs * 8" | bc -l
echo $rateMBs "MBs"
echo $rateMbs "Mbs"
Estimating Download Time
To estimate the time to download a file of a particular size to your system, try the Download Time Calculator.