If you like to know your internet speed from any of Operating system. In this post we would try know HowTo test internet speed from command-line.

I know many person, those open browser and like to open some website to check internet speed but same could easily determine from command-line from Any of operating system. Here we will try to work on same to know some simple ways to know internet speed through command-line.

First we would try to check internet speed on Linux machines. We would work on two tools to same.

Speedtest-cli

This tool need to clone from Git as mention below.

On Linux/Unix Machines from Git

root@srv:~# git clone https://github.com/sivel/speedtest-cli.git
Cloning into 'speedtest-cli'...
remote: Counting objects: 913, done.
remote: Total 913 (delta 0), reused 0 (delta 0), pack-reused 913
Receiving objects: 100% (913/913), 251.31 KiB | 61.00 KiB/s, done.
Resolving deltas: 100% (518/518), done.
Checking connectivity... done.

On Linux/Unix Machines from its repository

We can also install it like below in Ubuntu machine.

Ubuntu Machine
root@jarvis:~# apt-get install speedtest-cli

RHEL/CentOS Machine
# yum install speedtest-cli

We can also install it through python pip installer like mentioned below.

# pip install speedtest-cli
Collecting speedtest-cli
  Downloading speedtest_cli-1.0.6-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-1.0.6
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

So we work with Git method here,once it directory get cloned, we need to run it with python as mentioned below.

root@srv:~/speedtest-cli# python speedtest.py 
Retrieving speedtest.net configuration...
Testing from Jio (41.38.16.12)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by YOU Broadband India Pvt Ltd. (Gurgaon) [1.58 km]: 80.226 ms
Testing download speed...........................................................
Download: 0.50 Mbit/s
Testing upload speed.............................................................
Upload: 0.76 Mbit/s

We can also share our result through below way.

root@srv:~/speedtest-cli# python speedtest.py --share
Retrieving speedtest.net configuration...
Testing from Jio (47.31.15.14)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Anjani Broadband Solutions Pvt Ltd. (Gurugram) [1.49 km]: 71.963 ms
Testing download speed................................................................................
Download: 0.22 Mbit/s
Testing upload speed................................................................................................
Upload: 0.41 Mbit/s
Share results: http://www.speedtest.net/result/6697527871.png

Result could be seen on browser :-

In case you install speedtest-cli package from repository like mention above for Ubuntu machine, then we can simple use speedtest command like used below for –simple option

We can also quite every other unimportant output with –simple option, Suppress verbose output, only show basic information.

root@srv:~# speedtest --simple
Ping: 103.307 ms
Download: 0.14 Mbit/s
Upload: 0.13 Mbit/s

On Windows Machines from Git

On windows machine first we should need to install python, Installation of python on windows machine is easy method and also covered in other post.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\sang>pip install speedtest-cli
Collecting speedtest-cli
  Downloading speedtest_cli-1.0.6-py2.py3-none-any.whl
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-1.0.6

After installation as above we can run as it was running on Linux/Unix machines

C:\Users\sang>speedtest --simple
Ping: 254.673 ms
Download: 1.76 Mbit/s
Upload: 0.90 Mbit/s

We can use speedtest tool on Linux/Unix/Windows machines for test your internet speed from command-line without visiting any browser or website.