The Linux system provides a very useful tool for checking the internet speed of your internet connection through a python-based CLI tool known as ‘Speedtest-cli’. Speedtest utility is so helpful for testing real-time internet speed. Most of the users prefer to solve their problems through the command line environment on Linux distribution. Therefore, the Speedtest is a command-line tool that allows users to conveniently test the internet speed via the terminal.
We will explore in this article today, how to install the Speedtest CLI tool on CentOS 8 and using Speedtest utility how to check internet speed via terminal.
Installing and testing internet speed through Speedtest-cli utility on CentOS 8
The Speedtest-cli is a python-based utility that is written in the python language. So, to install the Speedtest-cli utility make sure that python should be installed on your system before. Check the installed python version on your CentOS 8 system by executing the below-mentioned command:
$ python --version
The installed version should display in the output. Otherwise, it will give you an error. If python is installed then, move further on to the installation of the Speedtest-cli tool. In our case, python is already installed on this system.
Install python on CentOS 8
This is a required step for the successful installation of the Speedtest-cli tool on your system. First, we will need to install python on our CentOS 8 system if it is not already installed. Type the below-mentioned command for python installation on CentOS 8:
$ sudo yum install python3-pip
Now, you can install the speedtest-cli utility on your system through two different methods.
- Install speedtest-cli utility using the python-pip tool
- Manually download and install Speedtest-cli.py script
Method 1: Install speedtest-cli utility using the python-pip tool
The Speedtest-cli utility can be installed directly on your CentOS 8 system through the python-pip tool by using the following command:
$ sudo pip3 install speedtest-cli
Once the installation of the speedtest-cli utility is completed, issue the following command to test your internet speed:
Method 2: Manually download and install Speedtest.py script
To check the internet speed through this method, you need to perform the following steps:
Step 1: Download speedtest.py script
Download the speedtest.py script file by using the ‘wget’ command:
$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
Step 2: Make executable
Once the above speedtest.py file is downloaded, issue the following command to make this file executable:
$ chmod +x speedtest-cli
Step 3: Internet speed test through speedtest-cli utility
Now, check the internet speed through the speedtest utility by using the following command:
By default, it shows the internet speed in bits. But, to display the internet speed in bytes, use the command which is given below:
$ ./speedtest-cli --bytes
Step 4: Generate URL to share speed test results
If you want to share your internet speed test result with someone then, type the following command:
$ ./speedtest-cli --share
The above command will generate a URL. Copy this Url and paste in the web browser the following results shows in your browser:
Similarly, to generate URL in bytes type the following command:
$ ./speedtest-cli --share --bytes
We have discussed two different methods through which you can install the Speedtest utility on your CentOS 8 system. In this article, we have also shown how to test the internet speed through the Speedtest-cli utility and how to generate URLs to share with others.