Ever thought “How to check Internet Speed via Terminal?” then you are in the right place. In we cover testing internet bandwidth with the speedtest CLI command line application. This provides a command line interface to interact with the speedtest.net service. We start with installation, basic usage, understanding the results, and advanced flags.
Introduction To Speedtest CLI
Speedtest CLI is a command line application that allows you to run Internet speed tests using the speedtest.net servers. This allows Linux users like system administrators to even run speed tests from servers or other systems without a graphical environment.
Originally speedtest-cli was provided via Python pip, but that has since changed, and now provide packages that work with Linux package managers.
Installation
To install on Debian and Ubuntu
sudo apt-get install curl
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
sudo apt-get install speedtest
To install on RHEL, CentOS, Fedora, and other RPM distros
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
sudo yum install speedtest
For other Operating Systems from FreeBSD to Windows checkout: speedtest.net/apps/cli
Basic Syntax
The basic syntax of the command is as simple as running:
speedtest
This will pick the best server based on the lowest ping time. (To observe use –selection-details)
However, if you wanted to do anything it would look like this:
Although if you wanted to do anything it would look like:
speedtest [options]
Understanding The Results
Below is an example of the results of running the speedtest command.
Server: Whitesky Communications LLC - Chicago, IL (id: 23097)
ISP: ProtonVPN
Idle Latency: 50.01 ms (jitter: 1.53ms, low: 49.61ms, high: 54.81ms)
Download: 227.60 Mbps (data used: 345.0 MB)
100.25 ms (jitter: 27.23ms, low: 56.02ms, high: 433.82ms)
Upload: 19.94 Mbps (data used: 13.0 MB)
122.62 ms (jitter: 37.57ms, low: 53.72ms, high: 310.86ms)
Packet Loss: 0.0%
Result URL: https://www.speedtest.net/result/c/[the-result-ID]
- Server and ISP Information
- Server is the speedtest server used in the test and ID is the speedtest server ID
- ISP is your Internet Service Provider or VPN provider
- Idle Latency
- Idle Latency is the time it takes for a packet to reach the speed test server and back.
- Jitter is the variation in latency over time.
- Low and High are the lowest and the highest latency observed.
- Download Speed
- The max download speed of the download and the data used during that test.
- The Latency experienced during the test.
- Jitter is the variation in latency over time.
- Low and High are the lowest and the highest latency observed.
- Upload Speed
- The max upload speed of the download and the data used during that test.
- The Latency experienced during the test.
- Jitter is the variation in latency over time.
- Low and High are the lowest and the highest latency observed.
- Packet Loss
- Packet Loss is the percent of packet loss observed during the test.
- Result URL
- Result URL if you would like to share the results of the speedtest you can share this URL.
Advanced Flags
Below are the flags I feel are the most useful pulled from the command’s documentation.
-L, –servers List nearest servers
-s, –server-id=# Specify a server from the server list using its id
-I, –interface=ARG Attempt to bind to the specified interface when connecting to servers
-o, –host=ARG Specify a server, from the server list, using its host’s fully qualified domain name
-p, –progress=yes|no Enable or disable progress bar (Note: only available for ‘human-readable’ or ‘json’ and defaults to yes when interactive)
–selection-details Show server selection details
-f, –format=ARG Output format (see below for valid formats)
Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty
-u, –unit[=ARG] Output unit for displaying speeds (Note: this is only applicable
Valid units for [-u] flag: bps, kbps, Mbps, Gbps, B/s, kB/s, MB/s, GB/s, kibps, Mibps, Gibps, kiB/s, MiB/s, GiB/s, auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes
Conclusion
Now you know internet speed tests don’t require a web browser nor a mouse, though an internet connection is required. In this post, we have discussed how to use speedtest CLI which is one way you can run a speedtest from a terminal, on servers and systems without a graphical environment. In this post, we cover installation, basic usage, understanding the results, and advanced flags.
Embracing a lifelong passion for technology since childhood, CJ delved into the intricate workings of systems, captivated by the desire to understand the unknown. This innate curiosity led to his discovery of Linux, a revelation that resonated deeply. With more than 7 years of on the job experience, he’s honed his technical skills as a Geek and Senior Linux Systems Administrator.
Leave a Reply