Linux terminal: speedtest_cli detects your real-time bandwidth speed
How fast are you uploading and downloading at home (or in the office? Can you ensure that you get an equivalent return when you pay for the ISP?
To test the speed of our Internet connection, there are some Internet services, such as SpeedTest, which is a Web service that can be browsed by web browsers and mobile apps.
Now, you can easily detect your network speed. Using speedtest_cli is also very simple. It is a command line interface that uses speedtest.net to test Internet bandwidth. In this way, you can also perform bandwidth tests on servers without browsers or graphical interfaces.
Install
Speedtest_cli is a python script, so it is really easy to install and use. You can install it in many ways:
1) pip/easy_install
Open a terminal and enter the following command:
- Pip install speedtest_cli
Or
- Easy_install speedtest_cli
2) Github
To install the SDK directly from github, you must:
- Pip install git + https://github.com/sivel/speedtest-cli.git
Or
- Git clone https://github.com/sivel/speedtest-cli.git
- Python speedtest-cli/setup. py install
3) as a Ubuntu/Debian or Mint package
The getdeb repository provides the installation package. You can install the package easily by following the steps below:
- Install the getdeb package
Or
- Manual repository Configuration:
Go to system management software source, third-party software options, and add:
- Deb http://archive.getdeb.net/ubuntu trusty-getdeb apps
Add the warehouse GPG key, open the terminal window, and enter:
- Wget-q-O-http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add-
Now, you can use the following command to install the speedtest_cli package:
- Sudo apt-get update
- Sudo apt-get install python-speedtest-cli
4) download (same as before)
In the last selection, you only need to download the python script and then run the script where you want to run it:
- Wget-O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
- Chmod + x speedtest-cli
Or
- Https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py curl-o speedtest-cli
- Chmod + x speedtest-cli
Basic usage
You can run speedtest_cli.py without any options, and then you will get a report on your bandwidth speed on the terminal. This is my bad Italian Adsl output:
- $./Speedtest_cli.py
- Retrieving speedtest.net configuration...
- Retrieving speedtest.net server list...
- TestingfromTelecomItalia (87.13.73.66 )...
- Selecting best server based on latency...
- HostedbyLepidaSpA (Bologna) [12.20 km]: 104.347 MS
- Testing download speed ........................................
- Download: 6.35 Mbits/s
- Testing upload speed ..................................... ..........
- Upload: 0.34 Mbits/s
This is the basic usage. This is enough to let you know that your Internet connection is good or bad, but you may want to share this information with your friends, you only need to use the-share option.
- ./Speedtest_cli.py -- share
- Retrieving speedtest.net configuration...
- Retrieving speedtest.net server list...
- TestingfromTelecomItalia (87.13.73.66 )...
- Selecting best server based on latency...
- HostedbyLepidaSpA (Bologna) [12.20 km]: 93.778 MS
- Testing download speed ........................................
- Download: 6.20 Mbits/s
- Testing upload speed ..................................... ..........
- Upload: 0.33 Mbits/s
- Share results: http://img.linux.net.cn/data/attachment/album/201409/11/153414kpd6xpiqs278f4xd.png
This will generate an image similar to the following (but I hope the value in your image is better ):
- ! [] (Http://img.linux.net.cn/data/attachment/album/201409/11/153414kpd6xpiqs278f4xd.png)
Another interesting option is-list, which lists all speedtest.net servers by distance. The following is my running result:
- Retrieving speedtest.net configuration...
- Retrieving speedtest.net server list...
- 2872) LepidaSpA (Bologna, Italy) [12.20 km]
- 1561) mynetway s. R. L. (Cesena, Italy) [80.97 km]
- 2710) ReteIVOby D. t. s. Srl (Florence, Italy) [90.90 km]
- 4826) InteplanetSrl (Verona, Italy) [100.45 km]
- 3998) Wolnext srl (Verona, Italy) [100.45 km]
- 2957) Wifiweb s. r. l. (AltavillaVicentina, Italy) [103.11 km]
- 3103) E4A s. r. l. (Vicenza, Italy) [107.17 km]
- 3804) InterplanetSrl (Vicenza, Italy) [107.17 km]
- 1014) NTRnet (Vicenza, Italy) [107.17 km]
- 3679) Hynet s r l (Vicenza, Italy) [107.17 km]
- 3745) ComeserSrl (Fidenza, Italy) [114.00 km]
- 5011) Welcomeitalia spa (Massarosa, Italy) [119.26 km]
- 2864) ReteIVOby D. t. s. Srl (Massa, Italy) [120.92 km]
- 2918) ReteIVOby D. t. s. Srl (Arezzo, Italy) [129.79 km]
- ...
Now that I know the ID of the server around me, I can use the-server option to select a specific server, so to select a server located in Florence (ID 2710, run the following command:
- ./Speedtest_cli.py -- server 2710
- Retrieving speedtest.net configuration...
- Retrieving speedtest.net server list...
- TestingfromTelecomItalia (87.13.73.66 )...
- HostedbyReteIVOby D. t. s. Srl (Florence) [90.90 km]: 106.505 MS
- Testing download speed ........................................
- Download: 6.18 Mbits/s
- Testing upload speed ..................................... .........
- Upload: 0.35 Mbits/s
Published by Asapy Programming Company
This article permanently updates the link address: