How to Check Internet Speed from the Linux Command Line | Baeldung on Linux (2024)

We’ve started a new DevOps area on the site. If you’re interested in writing about DevOps, check out the Contribution Guidelines.

1. Overview

In today’s fast-paced digital world, having a reliable and high-speed internet connection is essential. Whether a casual user, a developer, or a system administrator, monitoring our internet speed is crucial to ensure smooth online experiences.

In this tutorial, we’ll explore how to use speedtest-cli, a command-line tool, to check internet speed in Linux. speedtest-cli is a lightweight, fast, and easy-to-use utility that provides accurate measurements of our internet connection’s upload and download speeds.

Before we delve into the installation and usage of speedtest-cli, let’s briefly understand what it is and how it works. speedtest-cli is a Python-based command-line interface for the popular Speedtest.net internet speed testing service. This tool allows us to measure our internet connection’s speed by connecting to the nearest Speedtest.net server and conducting a series of upload and download tests.

3. Installation

speedtest-cli is available as a Python package, and we can install it using pip:

$ sudo pip install speedtest-cli

Once the installation is complete, we can check the version of speedtest-cli by using the –version argument:

$ speedtest-cli --version

This will display the version of speedtest-cli that is currently installed on our system.

4. Performing a Speed Test

With speedtest-cli now installed on our system, we’re ready to perform a speed test, So, let’s open a terminal and run the program without any arguments:

$ speedtest-cli...Testing download speed................................................................................Download: 106.32 Mbit/sTesting upload speed......................................................................................................Upload: 31.21 Mbit/s

Note that if the previous command returns a “403 Forbidden” error, we can use the –secure flag to force speedtest-cli to use HTTPS instead of HTTP when communicating with Speedtest.net servers.

5. Interpreting the Results

After running the speedtest-cli command, we’ll receive the test results as its output. This output will include details such as our public IP address, the server used for testing, and the ping (latency) time. The most crucial information, however, is the internet speed measurements.

5.1. Download Speed

The download speed represents how fast data can be pulled from the internet to our device. It’s measured in megabits per second (Mbps). A higher download speed indicates faster loading times for websites, quicker file downloads, and smoother streaming experiences.

5.2. Upload Speed

The upload speed, also measured in megabits per second (Mbps), represents how fast data can be sent from our device to the internet. This is essential for activities like uploading files, sending emails with attachments, and engaging in video calls.

6. Customizing speedtest-cli Options

speedtest-cli comes with various options that allow us to customize the testing experience. Let’s look at some of its most useful options.

6.1. Choosing a Specific Server

By default, speedtest-cli automatically connects to the nearest Speedtest.net server for testing. However, we can specify a particular server using its ID or name to conduct the speed test with that specific server:

$ speedtest-cli --server SERVER_ID_OR_NAME

We can get the list of available servers using the –list argument:

$ speedtest-cli --list

We should note that the list is sorted by distance in descending order — the topmost servers are the ones nearest to us.

6.2. Output in Different Formats

If we need to process the speed test results programmatically or save them to a file, we can use available output formats like JSON or CSV:

$ speedtest-cli --json$ speedtest-cli --csv

We should note that when using CSV format, the speed is always measured in bits per second. In addition, we can use the –csv-header option to print the column names header.

6.3. Sharing the Test Results

It’s easy to share the test results with others via a public results-sharing service from Speedtest.net by invoking the command with the –share option:

$ speedtest-cli --share

Basically, this will upload our test results to Speedtest.net and generate a unique URL that we can share with others. Accordingly, the URL will display the details of our test results, including the download and upload speeds, ping time, and server location.

7. Conclusion

As we’ve seen in this article, speedtest-cli is a powerful, versatile, and user-friendly tool that can help us measure and monitor our internet connection’s performance in Linux. Whether we’re casual users, developers, or system administrators, having a reliable and fast internet connection is key to ensuring smooth online experiences.

We’ve explored how we can quickly and easily perform speed tests, customize the testing experience, and share our test results with others. As a result, by using this tool, we can identify potential issues, troubleshoot problems, and optimize our internet connection’s performance for the best online experience possible.

How to Check Internet Speed from the Linux Command Line | Baeldung on Linux (2024)

References

Top Articles
Savannah Bananas Announce Roster for 2024 Banana Ball World Tour - The Savannah Bananas
Baseball HOF opening Savannah Bananas exhibit
Swimgs Yuzzle Wuzzle Yups Wits Sadie Plant Tune 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Autumns Cow Dog Pig Tim Cook’s Birthday Buff Work It Out Wombats Pineview Playtime Chronicles Day Of The Dead The Alpha Baa Baa Twinkle
Terrorist Usually Avoid Tourist Locations
Occupational therapist
Blanchard St Denis Funeral Home Obituaries
How to change your Android phone's default Google account
San Diego Terminal 2 Parking Promo Code
Kris Carolla Obituary
Mail Healthcare Uiowa
Minn Kota Paws
Cube Combination Wiki Roblox
Seth Juszkiewicz Obituary
Moe Gangat Age
Turning the System On or Off
Blackwolf Run Pro Shop
Lawson Uhs
Beryl forecast to become an 'extremely dangerous' Category 4 hurricane
Glenda Mitchell Law Firm: Law Firm Profile
Catherine Christiane Cruz
Bible Gateway passage: Revelation 3 - New Living Translation
Jordan Poyer Wiki
Cognitive Science Cornell
Grave Digger Wynncraft
Kuttymovies. Com
Gesichtspflege & Gesichtscreme
Proto Ultima Exoplating
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Panchang 2022 Usa
Murphy Funeral Home & Florist Inc. Obituaries
Robot or human?
Hermann Memorial Urgent Care Near Me
Greater Keene Men's Softball
Indio Mall Eye Doctor
Citibank Branch Locations In Orlando Florida
Craigs List Hartford
The Conners Season 5 Wiki
Tunica Inmate Roster Release
If You're Getting Your Nails Done, You Absolutely Need to Tip—Here's How Much
Promo Code Blackout Bingo 2023
Anthem Bcbs Otc Catalog 2022
National Weather Service Richmond Va
Advance Auto.parts Near Me
Random Animal Hybrid Generator Wheel
Theater X Orange Heights Florida
Rick And Morty Soap2Day
Motorcycle For Sale In Deep East Texas By Owner
Is TinyZone TV Safe?
Pilot Travel Center Portersville Photos
March 2023 Wincalendar
Costco Tire Promo Code Michelin 2022
Dcuo Wiki
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 6536

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.