This program is a python-developed scripting program that leverages Speedtest.net's services to measure the bandwidth of the upper and lower lines. SPEEDTEST-CLI can be based on the physical distance from the speed of the engine room to list the speed server, or for a server to speed up, but also for you to 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.
Installing SPEEDTEST-CLI on Linux
There are two ways to install SPEEDTEST-CLI. The first method needs to use the python-pip
Package Manager, the second method needs to install the Python script, build the installation files and then run, here we introduce two methods:
Installing SPEEDTEST-CLI with Pythin-pip
First you need to install python-pip
the Package Manager, then you can use the PIP command to install SPEEDTEST-CLI
$ sudo apt-get install python-pip
$ sudo pip install speedtest-cli
If you want to upgrade SPEEDTEST-CLI to the latest version, you need to enter the following command
$ sudo pip install speedtest-cli --upgrade
Install SPEEDTEST-CLI via Pyhton script
First, use the wget command to get the Python script from GitHub, then extract the downloaded file (master.zip)
$ wget https://github.com/sivel/speedtest-cli/archive/master.zip
$ unzip master.zip
After extracting the file, go to the extracted directory speedtest-cli-master
and make the script executable.
$ cd speedtest-cli-master/
$ chmod 755 speedtest_cli.py
Next, move the executable script to the /usr/bin
folder so that you don't have to enter the full script path every time.
$ sudo mv speedtest_cli.py /usr/bin/
Using SPEEDTEST-CLI to test Internet connectivity speed
1. To test your download and upload speed, only need to run the speedtest-cli
command, do not need to take parameters.
$ speedtest_cli.py
Test upload download speed under Linux
2. Test the upload download speed (in bytes)
$ speedtest_cli.py --bytes
Test the speed of the bytes
3. The tool provides a link to download images generated by your broadband test results that you can share to your family and friends.
Share Speed Results
The picture below is the one you created with the above command line speed.
Speed results
4. If you just need to ping, upload, download the results, run the following command:
$ speedtest_cli.py --simple
Test ping, upload, download speed
5. List speedtest.net
all servers distance to your physical distance, in kilometers (km)
$ speedtest_cli.py --list
List servers for Speedtest.net
6. After getting a very long list of servers, how do I list a server I want? What if I want to find a server in Mumbai (India) in the Speedtest.net server list?
$ speedtest_cli.py --list | grep -i Mumbai
List the closest servers
7. Speed up the specified server. We use the server ID obtained in example 5 and example 6 above:
$ speedtest_cli.py --server [server ID]
$ speedtest_cli.py --server [5060]## 这里使用服务器ID为5060作为例子
Speed up the specified server
8. Output speedtest-cli
version information and help documentation
$ speedtest_cli.py --version
Output version number
$ speedtest_cli.py --help
Output Help documentation
Reminder: The delay in the report is not an exact result and should not be relied upon; This value can be used as a relative delay, which is reliable for you to select a test server. At the same time, the CPU and memory capacity can affect the accuracy of the results.
Conclusion
System administrators and developers should have this simple scripting tool, this lightweight tool is full-featured, it's awesome. The reason I don't like speedtest.net is that it's used for Flash, and the opposite speedtest-cli just poked in my pain point.
SPEEDTEST_CLI is a third-party tool and cannot automatically record broadband speeds. Speedtest.net has millions of users and you can make a small speed server on your own.
Linux up and down network test