Command Line Internet Speed Test

Problem

I wanted to be able to run speed tests to make sure that I was getting the internet speeds that I was paying for. While a speedtest can be done from the web browser, the actual speeds that it reports can be hampered by the speed of the computer trying to keep the graphics updated on the screen.

Solution

I searched the internet and eventually found a way to do this. This is designed to be ran from a Linux-based system, but can be converted to run on a Windows-based system as well. The "test10" file is to test how long it would take to download a 10MB file on your connection. Likewise, there are "test100" and "test1000" files that can be used to test. Just have to change the URL in the script below.

The Script

#!/bin/bash

################################################################################
# Description: Tests the connection speed of the internet by downloading a 10 MB
# file from the internet.
# Date: 2015-10
# Author: Kenny Robinson, @almostengr
################################################################################

## SCRIPT MAIN ##
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip

Output

$ wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
--2023-01-17 16:57:04--  http://speedtest.wdc01.softlayer.com/downloads/test10.zip
Resolving speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)... 169.54.48.218, 2607:f0d0:3006:154::3
Connecting to speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)|169.54.48.218|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11536384 (11M) [application/zip]
Saving to: ‘/dev/null’

/dev/null                                     100%[================================================================================================>]  11.00M  4.26MB/s    in 2.6s    

2023-01-17 16:57:06 (4.26 MB/s) - ‘/dev/null’ saved [11536384/11536384]
Updated: 2023-01-17 | Posted: 2017-12-16
Author: Kenny Robinson