Command Line Apps to Perform a Internet Speed Test on Linux

Command Line Apps to Perform a Internet Speed Test on Linux
Internet connection speed tests are helpful for finding out network connection problems, ISP throttling, server throttling, or other connectivity issues. This article will list some of the most popular methods to conduct speed tests in Linux using command line apps.

Fast-cli

Fast-cli is a command line utility to check download and upload speeds of your network. It is based on Fast.com website made by Netflix and a series of tests are run on Netflix’s own production servers.

To install Fast-cli on Ubuntu, run the commands below:

$ sudo apt install npm
$ npm install –global fast-cli

To check network speed using Fast-cli, run the command below:

$ fast –upload

Speedtest-cli

Speedtest-cli is a command line utility that uses speedtest.net to check network bandwidth speed. It can check both download and upload speeds as well as server response time.

To install Speedtest-cli in Ubuntu, run the commands below:

$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/
speedtest-cli/master/speedtest.py
$ chmod +x speedtest-cli

To perform a speed test using speedtest-cli, run the command below:

$ ./speedtest-cli –simple

Wget

Wget is a command line download manager that can fetch files using HTTP, HTTPS and FTP protocols.

To install wget in Ubuntu, run the command below:

$ sudo apt install wget

To perform a download speed test (without upload), run the command below:

$ wget -O /dev/null -q –show-progress http://speedtest.newark.linode.com/100MB-newark.bin

The command above uses free speed test service provided by Linode for testing their servers. You can replace “newark” part in the command above with any other server listed on Linode’s speed test page available here.

Youtube-dl

Youtube-dl is a command line utility to download YouTube files in various audio and video formats. It is possible to check download speed by downloading a YouTube video using youtube-dl.

To install youtube-dl in Ubuntu, run the command below:

$ sudo apt install youtube-dl

To perform a speedtest using youtube-dl, run the following command:

$ youtube-dl -f best –no-part –no-cache-dir -o /dev/null –newline
https://www.youtube.com/watch?v=vzfZgVywscw

The command above downloads a video from KDE Community YouTube channel. You can replace the YouTube URL with your own. The “/dev/null” part ensures that video is not saved anywhere on the filesystem.

The biggest advantage of using youtube-dl to perform a speedtest is its built-in option to bypass geo restrictions. To download a video from a different country, use the command below:

$ youtube-dl -f best –no-part –no-cache-dir -o /dev/null
–newline –geo-bypass-country US https://www.youtube.com/watch?v=vzfZgVywscw

Replace the “US” part with any other ISO 3166-2 country code.

Curl

Curl is a command line utility that allows data transfer using URLs. These URLs are not limited to HTTP protocol only, as curl supports many other standards. Curl is used a lot for testing and interacting with RESTful APIs.

To install curl in Ubuntu, run the command below:

$ sudo apt install curl

To perform a speedtest using curl, use the following command:

$ curl -o /dev/null http://speedtest-blr1.digitalocean.com/10mb.test

The command above uses Digital Ocean servers to test the network speed. You can replace the URL with any other Digital Ocean server listed here.

Note that curl displays speed in KB/sec. To convert it to MB/sec (similar to wget’s output), you have to multiply the result with 0.001. The speed in the screenshot above would be 6794 KB/sec * 0.001 = 6.794 MB/sec.

Aria2

Aria2 is a command line download manager for Linux. It can pause and resume downloads from servers that support resuming. It also provides an option for multi-threaded downloading.

To install aria2 in Ubuntu, run the command below:

$ sudo apt install aria2c

To perform a speedtest using aria2, run the command below:

$ aria2c -d /dev -o null –allow-overwrite=true –file-allocation=none
http://speedtest-blr1.digitalocean.com/10mb.test

Ignore the error shown in the screenshot above. The command above uses Digital Ocean’s server to do a speedtest (as explained earlier). You can replace the URL with any other Digital Ocean server listed here.

Conclusion

These are some of the methods you can use to test network speed using command line apps. If you are just looking to test download speed, wget is pretty straightforward to use. For testing both download and upload speeds, use fast-cli or speedtest-cli app.

Related Posts
Leave a Reply

Your email address will not be published.Required fields are marked *