Linux Command Line test network speed
In many cases, we need to test the uplink and downlink bandwidths of Linux servers. Speedtest.net may be one of the most widely used websites ".
Speedtest.net provides a command line version-speedtest-cli. The following shows how to use speedtest-cli in Linux Command Line to test the bandwidth connection speed.
1. Install speedtest-cli
Speedtest-cli is a lightweight Linux Command Line tool written in Python. It can be run from Python 3.4 to Python. It is based on the infrastructure of Speedtest.net to measure the uplink/downlink speed of the network. Installing speedtest-cli is simple-you only need to download its Python script file. The tutorial on the Internet is very old, and only the expired script will be reported. The update is as follows:
Wgethttps: // raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
Chmod a + rx speedtest. py
Mv speedtest. py/usr/local/bin/speedtest-cli
Chown root: root/usr/local/bin/speedtest-cli
Speedtest-cli
You can also download speedtest. py from your computer and upload it to the server.
Ii. Use speedtest-cli to test the network speed
Using the speedtest-cli command is also simple, and it can work without any parameters.
[Root @ localhost temp] # speedtest-cli
After you enter this command, it will automatically find the nearest Speedtest.net server (geographic distance), and then print the Network/downlink rate of the test.
[Root @ localhost temp] # speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from China Telecom (219.135.214.145 )...
Selecting best server based on latency...
Hosted by CTM Internet Services (Macau) [106.48 km]: 55.974 MS
Testing download speed ........................................
Download: 3.15 Mbit/s
Testing upload speed ..................................................
Upload: 0.58 Mbit/s
Test result Description: The behavior is 0.58 Mbit/s and 3.15 Mbit/s.
Of course, the test results may not always be able to meet this value in actual applications. It can only be used as a reference.