Testing your internet speed from the command line on Windows, Linux, or Mac
Table of Contents
I've recently come across the need to test the internet speed of devices without a Graphical User Interface (GUI) connected to the internet.
Devices include Raspberry Pi, virtual machines running Linux, cloud-based containers running Linux distros, and more.
Services like speedtest.net and fast.com are both very popular speed testing services, and you may recognize them by their UI:
When a UI is not available to us, running speed tests from the command line is another option that comes in handy. Let's explore a few options.
Speedtest using the Fast CLI (npm)
This solution works on any system where npm
is available, including Windows, Mac, and Linux.
There's a GitHub project for the fast-cli, available as an npm package.
Install the package:
npm install --location=global fast-cli
Run the speed test:
fast -u
Note: I'm adding the -u
flag to also measure the upload speed. By default, it measures download speed only.
Speedtest using the speed-test CLI (npm)
This solution works on any system where npm
is available, including Windows, Mac, and Linux.
Install via npm:
npm install --location=global speed-test
Run the speed test:
speed-test
Speedtest using the speedtest-cli (Linux only)
On any of my Raspberry Pi and other IoT-enabled devices where I have a Linux-based OS, or my cloud-based VMs and containers running Linux, the speed test can be done by installing the official speedtest-cli.
Install with apt install
:
sudo apt install speedtest-cli
Run the speed test:
speedtest
It became clear to me that my Raspberry Pi (from the screenshot above), is a slightly older model where it only supports 100 Mbit ethernet. Newer models have Gigabit capabilities.
That's it. Enjoy testing your speeds!
Recent comments