Quickly Test Internet Speed From Linux Terminal


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:

sudo apt install speedtest-cli

installing speedtest-cli in Linux Mint

Once it is installed, to run the default speed test, type in the Terminal:

speedtest-cli

default speedtest-cli run

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 :

speedtest-cli --no-upload

testing only the download speed using speedtest-cli

Similarly, to test only the upload speed and skip download speed, use the parameter –no-download:

speedtest-cli --no-download

testing only the upload speed using speedtest-cli

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:

speedtest-cli --list

getting a list of nearby servers using speedtest-cli

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:

speedtest-cli --server 9512

testing with a specific server id using speedtest-cli

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:

speedtest-cli --no-upload --server 9512

using speedtest-cli to exclude upload or download test using specific testing servers

You can also use the -h parameter to know about other options:

speedtest-cli --h

speedtest-cli parameters for use

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.


Leave a Comment