Use the command line tool Speedtest-CLI to test your upstream/downstream network speed

Source: Internet
Author: User

Use the command line tool Speedtest-CLI to test your upstream/downstream network speed

We often need to check whether the network between the home and the Office is connected. What should we do? Open the website and start the test. The website loads JavaScript scripts in the browser, selects the best server speed measurement, and uses Flash to generate graphical results.

What about remote servers? You need to know that most remote servers do not have a browser to open the web page. This is where you can open the bottleneck of Web Page speed in your browser. You cannot perform regular tests on your servers as planned. In this case, you need a software named Speedtest-cli to break this bottleneck. It allows you to test the speed of Internet connection through the command line.

What is Speedtest-cli?

This program is a script program developed based on Python. It uses the service to measure the upstream and downstream bandwidth. Speedtest-cli can list the speed Servers Based on the physical distance from the data center to the speed server, or speed the servers. It can also generate a URL for you to share your speed results.

To install the latest version of speedtest-cli on Linux, you must install Python 2.4-3.4 or later.


Install speedtest-cli on Linux

You can install speedtest-cli in two ways. The first method is requiredpython-pipPackage Manager. The second method requires installing the Python script, generating the installation file, and then running it. here we will introduce two methods:


Install speedtest-cli using pythin-pip

First you need to installpython-pipPackage Manager, and then you can use the pip command to install speedtest-cli

  1. $ sudo apt-get install python-pip
  2. $ sudo pip install speedtest-cli

To upgrade speedtest-cli to the latest version, enter the following command:

  1. $ sudo pip install speedtest-cli --upgrade


Install speedtest-cli using the Pyhton script

First, use the wgetcommand to extract the downloaded file ( from github)

  1. $ wget
  2. $ unzip

After extracting the file, go to the extracted directory.speedtest-cli-masterThen the script can be executed.

  1. $ cd speedtest-cli-master/
  2. $ chmod 755

Next, move the executable script/usr/binFolder so that you do not have to enter the complete script path every time.

  1. $ sudo mv /usr/bin/


Use speedtest-cli to test the Internet connection speed

1. To test your download and upload speed, you only need to runspeedtest-cliCommand without parameters.

  1. $

Test the upload/download speed in Linux

2. Test the upload/download speed (in bytes)

  1. $ --bytes

Test bytes speed

3. The tool provides a link to download images generated by your broadband test results. You can share them with your family and friends.

Share speed test results

The following figure shows the image generated by speed test using the command line above.

Speed Test Result

4. If you only need to Ping, upload, and download the results, run the following command:

  1. $ --simple

Test Ping, upload, and download speeds

5. Listspeedtest.netAll servers are physically located in kilometers (km)

  1. $ --list

List servers of

6. After obtaining a very long list of servers, how can I list a server I want? What if I want to find the server in Mumbai (India) in the server list?

  1. $ --list | grep -i Mumbai

List the most recent servers

7. Speed the specified server. We use the server ID obtained in Example 5 and Example 6 above:

  1. $ --server [server ID]
  2. $ -- server [5060] # Here we use server ID 5060 as an Example

Measure the speed of a specified server.

8. Outputspeedtest-cliVersion information and help documentation

  1. $ --version

Output version number

  1. $ --help

Output help document

Note: The latency in the report is not the exact result and should not be too dependent on it. This value can be regarded as relative latency, which is reliable for you to choose a test server. At the same time, the CPU and memory capacity will affect the accuracy of the results.



System Administrators and developers should have to use this simple script tool. This lightweight tool has complete functions and is really awesome. The reason why I don't like is that it uses flash. On the contrary, speedtest-cli just marked my pain points.

Speedtest_cli is a third-party tool and cannot automatically record the bandwidth speed. has millions of users. You can create a small speed server by yourself.

The above is all content. For more information, please stay tuned to us. If you have any feedback, remember to comment at the bottom of the Article. If you like, don't forget to give us a thumbs up and share our article.


Author: Avishek Kumar Translator: NearTan Proofreader: wxy

This article was originally translated by LCTT and launched with the Linux honor in China

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.