• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to check internet speed from command line using Speedtest CLI tool

{{postValue.id}}

To check internet speed from command line using Speedtest CLI tool

In this article we will discuss how to check internet speed from command line using Speedtest CLI tool. Speedtest-cli tool is a script developed in Python programming language which measures the bandwidth speed bidirectionally.

To install speedtest-cli Using Python Script

Example

[user1@linuxhelp Desktop]$ wget https://github.com/sivel/speedtest-cli/archive/master.zip
--2016-03-05 02:41:08--  https://github.com/sivel/speedtest-cli/archive/master.zip
Resolving github.com... 192.30.252.131
Connecting to github.com|192.30.252.131|:443... connected..
...
...
Saving to: “ master.zip” 

100%[======================================> ] 17,653      65.9K/s   in 0.3s    

2016-03-05 02:41:10 (65.9 KB/s) - “ master.zip”  saved [17653/17653] 

[user1@linuxhelp Desktop]$ unzip master.zip 
Archive:  master.zip
7b09d8759fcbbda8a71aa49a4eaa825581b07439
   creating: speedtest-cli-master/
  inflating: speedtest-cli-master/.gitignore  
  inflating: speedtest-cli-master/.travis.yml  
  inflating: speedtest-cli-master/CONTRIBUTING.md
  ...
  ...
  inflating: speedtest-cli-master/speedtest_cli.py  
  inflating: speedtest-cli-master/tox.ini  

To make the script file executable

Example

[root@linuxhelp Desktop]# cd speedtest-cli-master/
[root@linuxhelp speedtest-cli-master]# chmod 755 speedtest_cli.py

To move the executable to /usr/bin folder

Example

[root@linuxhelp speedtest-cli-master]# mv speedtest_cli.py /usr/bin/


To test the speed of your internet connection

Run the following speedtest-cli command without any argument as shown below.

Syntax
speedtest_cli.py

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Bharti Airtel (125.17.109.94)...
Selecting best server based on latency...
Hosted by Mahanagar Telephone Nigam Ltd (Mumbai) [1.15 km]: 48.827 ms
Testing download speed........................................
Download: 5.14 Mbit/s
Testing upload speed..................................................
Upload: 5.46 Mbit/s

To check the speed result in bytes

Syntax
speedtest_cli.py --bytes

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --bytes
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Bharti Airtel (125.17.109.94)...
Selecting best server based on latency...
Hosted by Mahanagar Telephone Nigam Ltd (Mumbai) [1.15 km]: 38.251 ms
Testing download speed........................................
Download: 0.67 Mbyte/s
Testing upload speed..................................................
Upload: 0.68 Mbyte/s

To share your bandwidth speed with others

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --share
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Bharti Airtel (125.17.109.94)...
Selecting best server based on latency...
Hosted by Mahanagar Telephone Nigam Ltd (Mumbai) [1.15 km]: 42.625 ms Testing download speed........................................
Download: 4.78 Mbit/s
Testing upload speed..................................................
Upload: 5.38 Mbit/s
Share results: http://www.speedtest.net/result/5140591446.png

For information about Download and upload

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --simple
Ping: 41.498 ms
Download: 5.34 Mbit/s
Upload: 5.42 Mbit/s

To list the speedtest.net server based upon physical distance

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --list
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
1827) Vodafone India (New Delhi, India) [3.13 km]
4156) MTS india (New Delhi, India) [3.13 km]
5727) Excitel (New Delhi, India) [3.13 km]
2608) Bharti Airtel Ltd (New Delhi, India) [3.13 km]
2812) Aircel (New Delhi, India) [3.13 km]
7847) Citycom Networks Pvt Ltd (New Delhi, India) [3.13 km]
7859) Ten to Ten (New Delhi, India) [3.13 km]
7382) Star Broadband Services (I) Pvt Ltd (New Delhi, India) [3.13 km]
6937) VeriVoz Communication Private Limited (New Delhi, India) [3.13 km]
8016) Spectranet (New Delhi, India) [3.13 km]
8031) Zapbytes Technologies Pvt. Ltd. (New Delhi, India) [3.13 km]
6588) YPT Entertainment House P. LTd. (New Delhi, India) [3.13 km]
7075) FusionNet (Noida, India) [12.18 km]
5369) Reliance Communication Limited (Gurgaon, India) [22.02 km]
6431) YOU Broadband India Pvt Ltd. (Gurgaon, India) [22.02 km]
4183) Tripleplay Broadband Pvt Ltd (Gurgaon, India) [22.02 km]
3377) Nextra Teleservices Pvt. Ltd. (Gurgaon, India) [22.02 km]
6936) RailTel (Gurgaon, India) [22.02 km]
7569) IriisNet Communication Pvt. Ltd. (Faridabad, India) [22.51 km]
5715) True Broadband Service (Ghaziabad, India) [22.84 km]

To get desired output

To see the speedtest.net server located in Mumbai, run the following command

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --list | grep -i Mumbai
1718) Vodafone India (Mumbai, India) [1159.84 km]
5060) Mahanagar Telephone Nigam Ltd (Mumbai, India) [1159.84 km]
2938) Reliance Communications (Mumbai, India) [1159.84 km]
6403) YOU Broadband India Pvt Ltd., Mumbai (Mumbai, India) [1159.84 km]
6454) YOU Broadband India Pvt Ltd. (Mumbai, India) [1159.84 km]
2827) Bharti Airtel Ltd (Mumbai, India) [1159.84 km]
4641) Reliance Jio Infocomm Ltd (Mumbai, India) [1159.84 km]
7950) SoftCall Coc Pvt Ltd (Mumbai, India) [1159.84 km]
7605) Idea Cellular Ltd. (Mumbai, India) [1159.84 km]
5965) HOME NET (Mumbai, India) [1159.84 km]
7838) Intech Online Pvt Ltd (Mumbai, India) [1159.84 km]
4883) Wan &  Lan Internet Pvt. Ltd. (Mumbai, India) [1159.84 km]
6746) SevenStar pvt ltd. (Mumbai, India) [1159.84 km]
7002) BSNL (Mumbai, India) [1159.84 km]
6675) Vovinet Broadband Pvt. Ltd. (Mumbai, India) [1159.84 km]

To test connection speed against a specific server

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --server 7631
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Bharti Airtel (125.17.109.94)...
Hosted by WOM Chile (Santiago) [16917.19 km]: 650.931 ms
Testing download speed........................................
Download: 3.14 Mbit/s
Testing upload speed..................................................
Upload: 3.85 Mbit/s

To check help and the version number of speedtest-cli tool

speedtest_cli.py --version

Example

[user1@linuxhelp Desktop]$ speedtest_cli.py --version
0.3.4
5140591446
speedtest_cli.py --help

[user1@linuxhelp Desktop]$ speedtest_cli.py --help
usage: speedtest_cli.py [-h] [--bytes] [--share] [--simple] [--list]
                        [--server SERVER] [--mini MINI] [--source SOURCE]
                        [--timeout TIMEOUT] [--secure] [--version]

Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------
https://github.com/sivel/speedtest-cli

optional arguments:
  -h, --help         show this help message and exit
  --bytes            Display values in bytes instead of bits. Does not affect
                     the image generated by --share
  --share            Generate and provide a URL to the speedtest.net share
                     results image
  --simple           Suppress verbose output, only show basic information
  --list             Display a list of speedtest.net servers sorted by
                     distance
  --server SERVER    Specify a server ID to test against
  --mini MINI        URL of the Speedtest Mini server
  --source SOURCE    Source IP address to bind to
  --timeout TIMEOUT  HTTP timeout in seconds. Default 10
  --secure           Use HTTPS instead of HTTP when communicating with
                     speedtest.net operated servers

Tags:
mason
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What option is used to get report regarding upload and download?

A

You can make use of the following speedtest_cli.py --simple

Q

How long the distance covers while listing the distance?

A

It covers almost top process (in terms of location)

Q

How to test the connection against speed of certain server?

A

With the help of following command speedtest_cli.py --server 7631

Q

What command is used to check in selective location?

A

That location must be your surrounding you can grep them and see "speedtest_cli.py --list | grep -i Mumbai"

Q

How to view the list of available options available in it?

A

Use help option speedtest_cli.py --help

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.