In this guide, we want to teach you to Check or Test Internet Speed in Linux Command Line Terminal. You can easily test your network data speed from the Linux command line by using Linux tools.
This tutorial will show you how to use speedtest-cli and ping commands to test your internet speed on Linux.
Steps To Check Internet Speed in Linux via Command Line Terminal
To complete this guide, you must have access to your server as a root or non-root user with sudo privileges. For this purpose, you can visit the Orcacore website and search for our initial server setup guides.
Now proceed to the following steps to test your network speed on Linux.
Step 1 – Check Internet Speed From Linux Command Line with speedtest-cli
The speedtest-cli is a Python tool that can be used to test Linux internet speeds. With this tool, you can test your internet upload and download speeds, and measure ping.
To use this too, you must install it on your Linux distro. The package is available in most Linux distros. You can easily use your Linux package manager to install it. Also, you can download the installer to get the latest speedtest-cli packages on Linux.
Install speedtest-cli on Debian / Ubuntu Linux
You can use the command below to install speedtest-cli on your Debian and Ubuntu Linux distros:
# sudo apt update
# sudo apt install speedtest-cli -y
If you plan to install the packages with the installer script, you can use the following curl command to download the speed test installer in Debian and Ubuntu Linux from the terminal:
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
Then, use the following command to install speedtest-cli on Debian and Ubuntu:
sudo apt install speedtest
Install speedtest-cli on Centos / RHEL / AlmaLinux / Rocky Linux
On the Centos and RHEL-based Linux distros, you can use the command below to install speedtest-cli:
# sudo yum install speedtest-cli -y #centos7-rhel7
# sudo dnf install speedtest-cli -y #centos8-rhel8-rhel9
Note: The speedtest-cli is available under the Epel repository on Centos and RHEL-based distros. Before installing speedtest-cli, you need to install Epel Repository:
# sudo yum install epel-release
#sudo dnf install epel-release
Also, you can use the installer script. To do this, you can run the commands below:
# curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash
# sudo dnf install speedtest
Test Network Speed with speedtest-cli
At this point, you can run a simple speed test by using the following command on your Linux terminal:
Note: This is for the installation with the default repository.
Wait for the result. In your output, you will see your upload and download speeds.
Also, you can get more information about your network by running the speedtest-cli command without any option:
This will show you information about your network during and after the internet speed test in Linux (such as IP address, test location, etc).
To get more options, you can use the command below:
If you install the packages with the installer script, you can run the command below to run the internet speed test from the terminal:
Accept the license agreement by pressing Y.
From the output, you will get a URL that you can use to check your results from the web browser.
Also, you can run the command below to get more information:
Step 2 – Check Internet Speed From Linux Command Line with ping
Another way that you can test your network speed is to use the ping command. You can test your ping (speed between two computers) against your router or any server on the internet.
The ping command is installed by default on the Linus distros. You can easily check your server’s internet speed by using the command below:
Also, you can test your network speed against a website. For example:
That’s it you are done.
If you prefer to Check your Internet Speed from the command line on Linux, you can easily use the ping and speedtest-cli commands on the Linux terminal to test your network speed.
Hope you enjoy it. You may be interested in these articles too: