LinuxCommandLibrary

speed-test

Measure network connection speed and latency

TLDR

Test your internet connection and ping speed

$ speed-test
copy

Print the results as JSON
$ speed-test --json
copy

Print the results in megabytes per second (MBps)
$ speed-test --bytes
copy

Print more detailed information
$ speed-test --verbose
copy

SYNOPSIS

speedtest [OPTIONS]

PARAMETERS

--list
    Display a list of Speedtest.net servers sorted by proximity.

--server ID
    Specify a server ID from the --list output to test against.

--share
    Generate and provide a shareable image link of your results.

--simple
    Suppress verbose output and display only the key metrics (ping, download, upload).

--json
    Output the results in JSON format, suitable for scripting and parsing.

--bytes
    Display results in bytes/second instead of bits/second.

--no-pre-allocate
    Disable pre-allocation of the upload buffer, potentially useful for low-memory systems.

--secure
    Use HTTPS for API and speedtest operations. (Default in recent versions).

--version
    Show the version number of the speedtest-cli client.

--help
    Display a help message and exit.

DESCRIPTION

The speedtest command, often referring to the widely used speedtest-cli (a Python-based client), allows users to measure their internet connection's download speed, upload speed, and ping (latency) directly from the command line. It interacts with the Speedtest.net service by Ookla, automatically selecting the best server based on ping, or allowing users to specify a server. This utility is invaluable for network diagnostics, verifying ISP claims, and troubleshooting connectivity issues, providing quick and reliable performance metrics without requiring a web browser. While speedtest-cli is a popular community-driven tool, Ookla also provides an official command-line client.

CAVEATS

The speedtest-cli tool relies on publicly available Ookla Speedtest servers. Results can be influenced by various factors including network congestion, server load, geographical distance to the chosen server, and local network conditions. It's important to note that speedtest-cli is a community-developed project and not officially maintained by Ookla. While reliable, for official diagnostic purposes, one might consider Ookla's own proprietary command-line tool if available.

INSTALLATION (FOR <I>SPEEDTEST-CLI</I>)

The most common way to install speedtest-cli is via pip, the Python package installer:

pip install speedtest-cli

Alternatively, many Linux distributions provide it through their package managers (e.g.,
sudo apt install speedtest-cli on Debian/Ubuntu,
sudo dnf install speedtest-cli on Fedora, or
sudo pacman -S speedtest-cli on Arch Linux).

BASIC USAGE EXAMPLES

Run a standard speed test:
speedtest

Run a simple test showing only key results:
speedtest --simple

List available servers and then test against a specific one (e.g., ID 12345):
speedtest --list
speedtest --server 12345

Get results in JSON format:
speedtest --json

HISTORY

The concept of an internet speed test from the command line gained significant traction with the development of speedtest-cli. This open-source, Python-based client emerged as a popular alternative to web-based speed testing, allowing users to interact with Ookla's Speedtest.net service directly from their terminals. Its widespread adoption solidified its place as the de-facto 'speedtest' command for many Linux users. While initially unofficial, its success eventually led Ookla to develop and release its own official command-line client, providing an additional option for users seeking command-line network performance measurements.

SEE ALSO

ping(8), traceroute(8), iperf3(1), netstat(8)

Copied to clipboard