For testing Internet speed from the Linux command-line, speedtest-cli is a tool based on the popular Internet speed test service speedtest.net which does that. This is useful when you don’t want to open the web browser every time to perform these speed tests.
Let’s take a look at how to use this command-line tool (this example uses Linux Mint):
Open the Terminal and install it with the following command:
Once it is installed, to run the default speed test, type in the Terminal:
The tool will first determine your public IP from the ISP and then use the nearest testing server based on it’s location to run the speed test.
By default, it will test both the download and upload speed. You can however change these settings with the help of additional parameters.
Test only the download or upload speed:
To run a speed test to check only the download speed and skip the upload test, use the parameter –no-upload :
Similarly, to test only the upload speed and skip download speed, use the parameter –no-download:
Getting a list of nearby testing servers:
Other than that, you can also manually select which specific testing server to use. For this, first, get a list of all the available servers based on the proximity of your IP location with the –list parameter:
The list will display the name of servers along with their IDs on the left and the distance on the right.
Testing with specific servers:
To select a specific server from this list, use the –server serverID parameter:
In the above example, a server with ID 9512 was selected for testing the speed.
The list of servers displayed will be different based on your public IP and so will be their IDs. You can also combine the above parameters to test either upload or download speeds using specific servers.
For example, to test only the download speed using the server with ID 9512, the command will be:
You can also use the -h parameter to know about other options:
This is a useful command-line tool for Linux Mint/Ubuntu that can quickly test your Internet speed without using a browser. You can also put it in a shell script and run it whenever needed.
(There is also a cool command-line download tool Axel that you can use for downloading files without a browser).
Happy testing.