Check internet speed from the command line

By | 1 April, 2016

So, i was fiddling with my raspberry pi and thought about checking the internet download and upload speed. After a few searches and tests, this seems to be the easiest and finest solution:

go to the cli and type:

[user]$ wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py

wait for the python script download, then:

[user]$ chmod +x speedtest-cli

and run it:

[user]$ ./speedtest-cli

It will do some settings, some magic, some downloads and uploads and it will tell you how fast you internet is on that computer/fridge/car/cat/raspberry pi (it all depends where you ran it).

You will get something like this, but hopefully with better speeds:

[user]$
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Meo - Servicos De Comunicacoes E (188.251.175.56)...
Selecting best server based on latency...
Hosted by NOS (Lisbon) [274.77 km]: 16.191 ms
Testing download speed........................................
Download: 29.01 Mbit/s
Testing upload speed..................................................
Upload: 18.91 Mbit/s

NOTE: If you get an error when doing the ‘wget’, try using the –no-check-certificate switch. You will notice the error will suggest it.

ANOTHER NOTE: you can run the test in a windows command line. If you noticed, the speedtest-cli.py is a python script, so just download it using the link on the wget command and run it from a command line using:

[user]$ python speedtest-cli.py

(Assuming you have python installed and on your PATH – and if its done right, you can just call the script without the ‘python’ part)

Not my credit. Got the tip from here:
askUbuntu – How to check Internet Speed via Terminal?