Test Internet Speed in Linux CLI

Posted by
Facebooktwitterredditpinterestlinkedintumblr

Have you ever wonder how to test Internet speed on Linux command line (CLI)? There is a script that does this which is called speedtest-cli created by sivel.This is very useful tool particularly if you only have access to Linux terminal and would like to test your Internet download and upload speed. Here are the steps on how to install and use it.

1. Create a new folder under /opt and name it speedtest-cli.

sudo mkdir /opt/speedtest-cli

2. Download the Phyton script.

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

3. Move the downloaded file to the folder created in step 1.

mv Downloads/speedtest-cli /opt/speedtest-cli/

4. Change the access permission.

chmod +x speedtest-cli

5. Usage.

$ speedtest-cli -h 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

Sample speed test result.

[email protected]:~$ /opt/speedtest-cli/speedtest-cli Retrieving speedtest.net configuration... Retrieving speedtest.net server list... Testing from XXXXX (X.X.X.X)... Selecting best server based on ping... Hosted by GCOMM Pty. Ltd. (XXXXX) [0.40 km]: 25.749 ms Testing download speed........................................ Download: 10.13 Mbit/s Testing upload speed.................................................. Upload: 0.66 Mbit/s