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:
$ npm install --global fast-cli
To check network speed using Fast-cli, run the command below:
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:
speedtest-cli/master/speedtest.py
$ chmod +x speedtest-cli
To perform a speed test using speedtest-cli, run the command below:
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:
To perform a download speed test (without upload), run the command below:
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:
To perform a speedtest using youtube-dl, run the following command:
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:
--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:
To perform a speedtest using curl, use the following command:
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:
To perform a speedtest using aria2, run the command below:
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.