Test Internet Speed from the Command Line

Test Internet Speed from the Command Line

Get Social!

speedtest-netMatt Martez has kindly created and shared a Python script for interacting with speedtest.net for testing bandwidth to the internet from the command line. This is a great script which only has the dependency of Python – something which is available on most Linux distributions.

Grab the script with wget to the server you wish to test. Remember, this is to test the bandwidth to servers which are publically available on the internet – this does not test your internal server to server communication. See Iperf for details on testing LAN bandwidth.

wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py

Add the execute permission:

chmod +x speedtest-cli

And that’s all you need to start your first speed test! Run the speedtest-cli with the –simple switch to start your first basic speed test. The script will automatically choose the best server based on your location.

./speedtest-cli --simple
Ping: 10.331 ms
Download: 6.47 Mbit/s
Upload: 5.30 Mbit/s

You can use the –help switch to see all the options you have with the tool.

./speedtest-cli --help
usage: speedtest-cli [-h] [--share] [--simple] [--list] [--server SERVER]
                     [--mini MINI] [--source SOURCE] [--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
  --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
  --version        Show the version number and exit


Leave a Reply

Visit our advertisers

Quick Poll

Which type of virtualisation do you use?
  • Add your answer

Visit our advertisers