Check Internet Speed in Linux Terminal

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.

speedtest-cli --simple

Wait for the result. In your output, you will see your upload and download speeds.

run a simple speedtest-cli

Also, you can get more information about your network by running the speedtest-cli command without any option:

speedtest-cli

This will show you information about your network during and after the internet speed test in Linux (such as IP address, test location, etc).

speedtest-cli server info (such as IP address, test location, etc).

To get more options, you can use the command below:

speedtest-cli -h
speedtest-cli options in Linux

If you install the packages with the installer script, you can run the command below to run the internet speed test from the terminal:

speedtest

Accept the license agreement by pressing Y.

License agreement Speedtest in Linux

From the output, you will get a URL that you can use to check your results from the web browser.

Check Internet Speed in Linux
Speed test results from web browser

Also, you can run the command below to get more information:

speedtest -h
Internet Speed test options commands in Linux

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:

ping your-ip-address

Also, you can test your network speed against a website. For example:

ping google.com

That’s it you are done.

Conclusion

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:

Execute .ps1 File on Linux Terminal

Update Timezone DB in Linux

Clear pip cache Safely

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!