«

»

Aug 08

How to test internet speed from the command line on Linux.

 

Speedtest-cli is a simple client written in Python CLI to measure bidirectional bandwidth Internet using the Speedtest.net infrastructure. It works with Python 2.4 to 3.4.

Installing Speedtest-cli using pip command:

sudo apt-get install python-pip
sudo pip install speedtest-cli

 

Installing Speedtest-cli manually:

wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
sudo chmod a+rx speedtest_cli.py
sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli
sudo chown root:root /usr/local/bin/speedtest-cli

 

Test internet speed using Speedtest-cli.

Speedtest-cli will automatically discover the closest Speedtest.net server and report download and upload speed measured from the server.

sudo speedtest-cli

 

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Virgin Media (203.187.66.157)...
Selecting best server based on latency...
Hosted by Virgin Media (Manchester) [14.95 km]: 13.476 ms
Testing download speed........................................
Download: 32.68 Mbits/s
Testing upload speed..................................................
Upload: 1.93 Mbits/s

  If you want to share the speed test result, you can use –share option, which will allow you to share speed test result with others in an image format via Speedtest.net.  

sudo speedtest-cli --share

 

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Virgin Media (203.187.66.157)...
Selecting best server based on latency...
Hosted by Virgin Media (Manchester) [14.95 km]: 8.245 ms
Testing download speed........................................
Download: 32.57 Mbits/s
Testing upload speed..................................................
Upload: 1.93 Mbits/s
Share results: http://www.speedtest.net/result/3657879242.png

speedtest-cli   If you want to get a list of available Speedtest.net servers around the world, use –list option. It will display a sorted list of Speedtest.net servers In the server list, each Speedtest.net server shows an associated server ID in front. You can manually specify server ID during testing, instead of using the geographically closest server.if you want to use a sever in Sydney (Australia), you can specify a corresponding server ID (eg, 3505).

sudo speedtest-cli --list

 

...
4775) CityLink Ltd (Auckland, New Zealand) [18137.11 km]
2720) WorldNet Services Ltd. (Auckland, New Zealand) [18137.11 km]
4953) Vodafone New Zealand (Auckland, New Zealand) [18137.11 km]
2382) Woosh Wireless (Auckland, New Zealand) [18137.11 km]
 721) WorldxChange Comm (Auckland, New Zealand) [18137.11 km]
4989) Two Degrees Mobile Ltd (Auckland, New Zealand) [18137.11 km]
4093) NetSmart Ltd (Tauranga, New Zealand) [18240.01 km]
3986) TrustPower Ltd (Tauranga, New Zealand) [18240.01 km]
 960) Enternet Online Ltd (Tauranga, New Zealand) [18240.01 km]
3639) Lightwire Limited (Hamilton, New Zealand) [18244.89 km]
3752) theCloud Limited (Hamilton, New Zealand) [18244.89 km]
...

 


sudo speedtest-cli --server 3505

 

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Virgin Media (203.187.66.157)...
Hosted by Vodafone Hutchison Australia (NN) (Sydney) [16983.81 km]: 330.088 ms
Testing download speed........................................
Download: 17.96 Mbits/s
Testing upload speed..................................................
Upload: 1.73 Mbits/s

 

speedtest-cli-server
 

Leave a Reply

Your email address will not be published. Required fields are marked *