There are several graphical websites which you can use to test your speed to the Internet, however at times we need to perform this test from the command line interface (CLI). In our environment this includes testing from our servers which do not have a graphical user interface (GUI).

Some searching around I came across a great little utility from Matt Martz which gives you command line access to speedtest.net

Head over to my GitHub account and download a copy for speedtest-cli.
https://github.com/KevinFairbanks/speedtest-cli

Install is optional or it can be ran directly from where you download it to, instructions are provided on the GitHub project.

Quick and Dirty Download: 

wget -O speedtest-cli https://raw.githubusercontent.com/KevinFairbanks/speedtest-cli/master/speedtest_cli.py

chmod +x speedtest-cli

 To run the default test simply use the following command:
./speedtest-cli

The default option will try to find the closest server to you and run a speedtest. To specify what server to use see the detailed usage options below.

Detailed Usage: 

[email protected]:~$ ./speedtest-cli -h
usage: speedtest-cli [-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
  --version          Show the version number and exit

 

Example Output:

[email protected]:~$ ./speedtest-cli 
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Verizon FiOS (72.90.94.148)...
Selecting best server based on latency...
Hosted by Punk Media (Syracuse, NY) [10.07 km]: 19.791 ms
Testing download speed........................................
Download: 38.61 Mbit/s
Testing upload speed..................................................
Upload: 30.99 Mbit/s

 

Follow Me

Kevin Fairbanks

Kevin Fairbanks is the Managing Partner at Purple Monkey Studio located in Syracuse, NY, Co-Owner/Programmer at bivvy located in Utica, NY and a Web Developer/Programmer for Quadsimia located in New York Mills, NY where he builds everything from responsive websites to applications. In his spare-time he is either spending it with his daughter or tinkering with electronics.
Follow Me

Latest posts by Kevin Fairbanks (see all)