How to Test Network Speed in Linux via CLI
Testing network speed in Linux via the command line can be achieved using a variety of tools.
Below is the common and simple method to know the Network speed.
Prerequisites
- A machine running Linux
- sudo / root permissions
- Access to a terminal / command-prompt window
Test Network Speed on Linux Via Command Line
The tools in this guide help you check the Internet and LAN speed on a Linux machine. The article uses Ubuntu 22.04 for instructions, but the utilities work for any Linux distribution.
Using speedtest-cli to Test Internet Speed
One of the most famous online internet connection test apps is speedtest.net. To install Speedtest on Linux via the terminal, use a package manager for your distro.
On Ubuntu, enter:
sudo apt install speedtest-cli
Optionally, use pip
to install speedtest-cli in Python:
sudo pip install speedtest-cli
To run the test, type:
speedtest
The standard speedtest-cli output shows all steps, including selecting a server. To display a shorter output, enter:
speedtest -simple
The test is simple to use and provides multiple options. To view all of them, pass the -h
flag to display the speedtest-cli help file.