Test Internet Connection Speed from the Command Line

Jul 31, 2013 - 1 Comment

The excellent wget tool provides for a simple way to test the speed of an internet connection directly from the command line. Though it’s bundled with most unix variations, Mac users will first need to grab wget for OS X in order for this to work, wget is a simple terminal utility used to download files from the web and ftp and it’s handy to have around for a variety of uses.

Speed test from the Command Line

If you’re already familiar with the command line you know what to do, but others can install wget, then launch Terminal (found in /Applications/Utilities/) and paste the following command string into the terminal:

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

Look to the righthand side of wget as it runs and you’ll see the connection speed (1.36m/s in the screen shot example). Because wget is pointing the downloaded file at /dev/null it won’t actually take up any hard drive space, so there is no concern about running this command repeatedly.

This uses the same SpeedTest servers that are available to mobile users through the Speed Test app, it can make for a decent way to directly compare connection speeds on a broadband connection vs cellular, without having to access the SpeedTest Flash-based web apps, and without having to compile any additional command line software.

Plan on using this trick often? Consider adding a simple alias to .bash_profile:

alias speedtest='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip'

Using an alias is obviously shorter and easier to remember, making it a bit more useful for scripts, automation, remote testing, and just for those of us who like to poke around in the Terminal.

This trick comes to us from @climagic on Twitter, be sure to follow @osxdaily there too if you haven’t done so yet.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks

One Comment

» Comments RSS Feed

  1. linuxishawt says:

    You don’t need to install any extra binaries for this to work, you can use the builtin curl with the lowercase ‘o’ to mimic the command.

    curl -o /dev/null

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates