When Internet speed is found to be slow, people usually first test their computer to the network service provider (often referred to as the "last kilometer") network connection speed. In websites that can be used to test broadband speeds,speedtest.net may be the most widely used.
However, when there is no graphical desktop (for example, when you remotely log on to a server via the command line or use an operating system that does not have a graphical interface), flash-based, user-friendly speedtest.net will not work. Fortunately, Speedtest.net provides a command-line version of--SPEEDTEST-CLI. Below I will show you how to test the broadband connection speed using SPEEDTEST-CLI on the Linux command line.
SPEEDTEST-CLI is a lightweight Linux command-line tool written in Python that runs under the Python2.4 to 3.4 version. It measures the upstream/downstream rate of the network based on the Speedtest.net infrastructure. Installing SPEEDTEST-CLI is simple-just download its Python script file.
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py chown root:root/usr/local/bin/speedtest-cli
Test speed with SPEEDTEST-CLI
Using the SPEEDTEST-CLI command is also simple, and it does not require any parameters to work.
After entering this command, it will automatically discover the nearest Speedtest.net server (geographic distance), and then print out the test's network/downlink rate.
If you are willing to share the test results, you can use the parameter "–share". It will upload your test results to the Speedtest.net server and share them graphically with others.
If you are interested in all currently available Speedtest.net servers, you can use the parameter "–list". It prints out all the Speedtest.net servers (sorted by from near from your geographic distance).
In the list above, each server has a corresponding ID in front of it. If you want to use the specified server to test your network speed, you only need to specify its ID after the SPEEDTEST-CLI command. For example, if you want to use a server on a Washington DC, you only need to specify the corresponding server ID (such as 935).
Use the Linux command line to test the speed-----speedtest-cli