2 Tools To Test Internet Speed From The Command Line

This article presents 2 command line tools for checking your Internet connection speed. This can be useful to check if your ISP does indeed offer the speeds it claims, to diagnose possible issues with your Internet connection, and so on.

Command line Internet speed test

You may want to use a command line Internet speed test in case you want to avoid having to visit a bloated website like speedtest.net, or if you want to measure the current Internet speed of your server / a remote machine . You can also use these in scripts.

How to test Internet download speed from a terminal using Fast (powered by Fast.com)


Fast is a simple utility with no dependencies (written in Go) for testing your Internet download speed from a terminal. The tool is powered by the Netflix Fast.com service, and it runs on Linux, *BSD, Mac, and Windows.

Released in May, 2016 by Netflix, fast.com is intended as a simple and quick way of allowing Internet users to test their current Internet speed, whether they are a Netflix member or not. It uses Open Connect CDN, a globally-distributed network of servers that's used for storing and serving Netflix content, being "a good representation of the performance that can be achieved during a real-life user scenario", mentions a post on the Netflix TechBlog, which includes a lot of technical information in case you're interested.

The tool is very simple and has no options whatsoever. Run it, and the command line utility will test your Internet download speed, showing the result provided by fast.com.

Fast binaries (and its source) can be downloaded from the application's GitHub releases page.

You can install it to /usr/local/bin on any Linux distribution by downloading the binary (fast_linux_amd64 on 64bit systems) in your home folder, then opening a terminal and typing (for the 64bit binary):

sudo install fast_linux_amd64 /usr/local/bin/fast

You can also install Fast on Linux from the Snapcraft store (requires having Snapd installed on your Linux system - it's installed by default on Ubuntu):

snap install fast

Now type fast in a terminal to check your Internet download speed. Example:

$ fast
 -> 10.18 Mbps

Tool seen recently on @snapcraftio (Twitter).

How to test Internet upload and download speed from a terminal using speedtest-cli (powered by speedtest.net)


speedtest-cli is a command line Python tool to test your Internet speed using www.speedtest.net. Using it you'll be able to check your Internet download and upload speed, as well as the ping.

The tool has numerous options, including the ability to specify the speedtest.net server to check the Internet speed against, show all available servers sorted by distance, only perform a download or upload test. It also has an option to generate and provide a URL to the speedtest.net share result image.

Install speedtest-cli:

  • Debian, Ubuntu, Linux Mint and other Debian or Ubuntu-based Linux distributions:
sudo apt install speedtest-cli

  • Fedora:
sudo dnf install speedtest-cli

  • openSUSE:
sudo zypper install speedtest-cli

  • Arch Linux / Manjaro:
sudo pacman -S speedtest-cli

On other Linux distributions search for it in the repositories, and install it from there. You can also easily install it using PIP or by downloading the Python script from the tool's GitHub project page.

To use speedtest-cli to test your Internet download and upload speed, as well as your ping, using the server that's closest to you, run speedtest in a terminal:

speedtest

Example with output:

$ speedtest
Retrieving speedtest.net configuration...
Testing from **** (***.**.*.***)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by **** [4.27 km]: 2.501 ms
Testing download speed........................................
Download: 6.11 Mbit/s
Testing upload speed..........................................
Upload: 11.67 Mbit/s

To suppress verbose output, only show basic information (excludes your public IP, and some other output), append --simple to the speedtest command:

speedtest --simple

Example with output:

$ speedtest --simple
Ping: 2.099 ms
Download: 4.37 Mbit/s
Upload: 12.50 Mbit/s

You can view a complete list of available Internet speed test servers, by running:

speedtest --list

To test your Internet download and upload speed against a specific server, copy the server ID from the --list command, and use that ID like this:

speedtest --server SERVER-ID

Generate and show an URL to the speedtest.net share result image using:

speedtest --share

Run speedtest-cli -h to see all the available options.