{"id":14872,"date":"2022-11-15T00:21:34","date_gmt":"2022-11-14T21:21:34","guid":{"rendered":"https:\/\/kifarunix.com\/?p=14872"},"modified":"2024-03-09T23:14:23","modified_gmt":"2024-03-09T20:14:23","slug":"easy-way-to-test-internet-speed-on-linux-terminal","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/easy-way-to-test-internet-speed-on-linux-terminal\/","title":{"rendered":"Easy way to Test Internet Speed on Linux Terminal"},"content":{"rendered":"\n<p>In this tutorial, we will show you an easy way to test Internet speed on Linux terminal. More often than not you might want to know or confirm the capacity at which your ISP network can transmit data here in referred to Internet speed or bandwidth. In most cases, folks uses browser-based tools to test their Internet speed. However, there are command line-centric ninjas that want to use Linux terminal or command line to test their Internet speed. This guide is for them, -:).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Test Internet Speed on Linux Terminal<\/h2>\n\n\n\n<p>One of the most popular sites that appears at the top of the Google search results for the keyword &#8220;speed test&#8221; is <a href=\"https:\/\/www.speedtest.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.speedtest.net<\/a> by Speedtest by Ookla.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1654\" height=\"866\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli.png\" alt=\"Easy way to Test Internet Speed on Linux Terminal\" class=\"wp-image-14880\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli.png 1654w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-768x402.png 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-1536x804.png 1536w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-150x79.png 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-300x157.png 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-696x364.png 696w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-1068x559.png 1068w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speed-test-linux-cli-802x420.png 802w\" sizes=\"(max-width: 1654px) 100vw, 1654px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>When you hit the Go button, the site will calculate your download and upload speed.<\/p>\n\n\n\n<p>Well, Speedtest by Ookla also provides a speedtest-cli tool that you can install on Linux systems to enable you perform Internet speed test on Linux terminal.<\/p>\n\n\n\n<p>As much as there could other command line based tools that you can use to test your ISP Internet speed test on a Linux command line, this guide will only focus on <a href=\"https:\/\/www.speedtest.net\/apps\/cli\" target=\"_blank\" rel=\"noreferrer noopener\">speedtest<\/a> cli tool by Ookla.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Speedtest CLI Tool<\/h3>\n\n\n\n<p>Install Speedtest CLI Tool on Ubuntu\/Debian<\/p>\n\n\n\n<p>Note that default Ubuntu repositories by default ships with another <a href=\"https:\/\/github.com\/sivel\/speedtest-cli\/\" target=\"_blank\" rel=\"noreferrer noopener\">speedtest-cli<\/a> tool which is available on the default Ubuntu universe repositories;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt info speedtest-cli<\/code><\/pre>\n\n\n\n<p>This tool has since become increasingly inaccurate with high-speed connections.<\/p>\n\n\n\n<p>Thus, you need to install speedtest utility by Ookla.<\/p>\n\n\n\n<p>As a result, you need to install Ookla repositories;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install wget curl gnupg2 apt-transport-https<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- https:\/\/packagecloud.io\/ookla\/speedtest-cli\/gpgkey | \\\ngpg --dearmor -o \/etc\/apt\/trusted.gpg.d\/ookla.gpg<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>echo -e \\\n\"deb https:\/\/packagecloud.io\/ookla\/speedtest-cli\/ubuntu\/ $(lsb_release -sc) main \ndeb-src https:\/\/packagecloud.io\/ookla\/speedtest-cli\/ubuntu\/ $(lsb_release -sc) main\" \\\n&gt; \/etc\/apt\/sources.list.d\/ookla.list<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Install Ookla speedtest CLI tool on Ubuntu\/Debian<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install speedtest<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Speedtest CLI Tool on CentOS\/Oracle\/Fedora Linux<\/h4>\n\n\n\n<p>Similarly, CentOS\/Fedora\/Oracle Linux ships with speedtest-cli too which has since become in-accurate with high-speed connections.<\/p>\n\n\n\n<p>To install Speedtest by Ookla on CentOS\/Oracle\/Fedora Linux;<\/p>\n\n\n\n<p>Install Epel repository;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install epel-release<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\necho -e \\\n\"[ookla_speedtest-cli]\nname=ookla_speedtest-cli\nbaseurl=https:\/\/packagecloud.io\/ookla\/speedtest-cli\/el\/`rpm -E %{rhel}`\/x86_64\nrepo_gpgcheck=1\ngpgcheck=0\nenabled=1\ngpgkey=https:\/\/packagecloud.io\/ookla\/speedtest-cli\/gpgkey\nsslverify=1\nsslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt\nmetadata_expire=300\" > \/etc\/yum.repos.d\/ookla_speedtest-cli.repo\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install speedtest<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Test Internet Speed on Linux Terminal<\/h3>\n\n\n\n<p>How can you use speedtest command line tool to test Internet connection speed?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>speedtest --help<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nSpeedtest by Ookla is the official command line client for testing the speed and performance of your internet connection.\n\nVersion: speedtest 1.2.0.84\n\nUsage: speedtest [<options>]\n  -h, --help                        Print usage information\n  -V, --version                     Print version number\n  -L, --servers                     List nearest servers\n  -s, --server-id=#                 Specify a server from the server list using its id\n  -I, --interface=ARG               Attempt to bind to the specified interface when connecting to servers\n  -i, --ip=ARG                      Attempt to bind to the specified IP address when connecting to servers\n  -o, --host=ARG                    Specify a server, from the server list, using its host's fully qualified domain name\n  -p, --progress=yes|no             Enable or disable progress bar (Note: only available for 'human-readable'\n                                    or 'json' and defaults to yes when interactive)\n  -P, --precision=#                 Number of decimals to use (0-8, default=2)\n  -f, --format=ARG                  Output format (see below for valid formats)\n      --progress-update-interval=#  Progress update interval (100-1000 milliseconds)\n  -u, --unit[=ARG]                  Output unit for displaying speeds (Note: this is only applicable\n                                    for \u2018human-readable\u2019 output format and the default unit is Mbps)\n  -a                                Shortcut for [-u auto-decimal-bits]\n  -A                                Shortcut for [-u auto-decimal-bytes]\n  -b                                Shortcut for [-u auto-binary-bits]\n  -B                                Shortcut for [-u auto-binary-bytes]\n      --selection-details           Show server selection details\n      --ca-certificate=ARG          CA Certificate bundle path\n  -v                                Logging verbosity. Specify multiple times for higher verbosity\n      --output-header               Show output header for CSV and TSV formats\n\n Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty\n\n Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision\n\n Valid units for [-u] flag: \n   Decimal prefix, bits per second:  bps, kbps, Mbps, Gbps\n   Decimal prefix, bytes per second: B\/s, kB\/s, MB\/s, GB\/s\n   Binary prefix, bits per second:   kibps, Mibps, Gibps\n   Binary prefix, bytes per second:  kiB\/s, MiB\/s, GiB\/s\n   Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes\n<\/code><\/pre>\n\n\n\n<p>You can simply execute it without no options to test Internet speed on Linux terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>speedtest<\/code><\/pre>\n\n\n\n<p>Accept the end user license agreement and proceed to test Internet connection speed.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n==============================================================================\n\nYou may only use this Speedtest software and information generated\nfrom it for personal, non-commercial use, through a command line\ninterface on a personal computer. Your use of this software is subject\nto the End User License Agreement, Terms of Use and Privacy Policy at\nthese URLs:\n\n\thttps:\/\/www.speedtest.net\/about\/eula\n\thttps:\/\/www.speedtest.net\/about\/terms\n\thttps:\/\/www.speedtest.net\/about\/privacy\n\n==============================================================================\n\nDo you accept the license? [type YES to accept]: YES\nLicense acceptance recorded. Continuing.\n\n\n   Speedtest by Ookla\n\n[error] Error: [0] Cannot open socket\n[error] Error: [0] Cannot open socket\n      Server: Vijiji Connect Limited - Nairobi (id: 38303)\n         ISP: Safaricom\nIdle Latency:    16.89 ms   (jitter: 0.37ms, low: 16.29ms, high: 17.29ms)\n<strong>    Download:    21.16 Mbps (data used: 28.5 MB)                                                   \n                 27.12 ms   (jitter: 17.47ms, low: 16.60ms, high: 907.09ms)\n      Upload:    19.43 Mbps (data used: 32.9 MB)                                                   \n                 22.03 ms   (jitter: 12.49ms, low: 17.13ms, high: 380.48ms)<\/strong>\n Packet Loss:     0.0%\n  Result URL: https:\/\/www.speedtest.net\/result\/c\/caf9b6f8-d4bb-4c09-b665-ed821c38659d\n<\/code><\/pre>\n\n\n\n<p>You can print the output in different formats;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>speedtest -f json-pretty<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\n{\n    \"type\": \"result\",\n    \"timestamp\": \"2022-11-14T21:09:01Z\",\n    \"ping\": {\n        \"jitter\": 0.993,\n        \"latency\": 16.579,\n        \"low\": 16.002,\n        \"high\": 18.150\n    },\n    \"download\": {\n        \"bandwidth\": 2731345,\n        \"bytes\": 27656856,\n        \"elapsed\": 10008\n    },\n    \"upload\": {\n        \"bandwidth\": 2451465,\n        \"bytes\": 27651819,\n        \"elapsed\": 10603,\n        \"latency\": {\n            \"iqm\": 21.777,\n            \"low\": 15.447,\n            \"high\": 363.695,\n            \"jitter\": 14.991\n        }\n    },\n    \"packetLoss\": 0,\n    \"isp\": \"Safaricom\",\n    \"interface\": {\n        \"internalIp\": \"10.0.2.15\",\n        \"name\": \"enp0s3\",\n        \"macAddr\": \"08:00:27:70:3D:6C\",\n        \"isVpn\": false,\n        \"externalIp\": \"41.xx.65.2x9\"\n    },\n    \"server\": {\n        \"id\": 21848,\n        \"host\": \"speedtest-thk.safaricom.com\",\n        \"port\": 8080,\n        \"name\": \"Safaricom\",\n        \"location\": \"Nairobi\",\n        \"country\": \"Kenya\",\n        \"ip\": \"197.248.2xx.102\"\n    },\n    \"result\": {\n        \"id\": \"14aa97ac-b2cc-4ca9-ac8b-5e32f445486c\",\n        \"url\": \"https:\/\/www.speedtest.net\/result\/c\/14aa97ac-b2cc-4ca9-ac8b-5e32f445486c\",\n        \"persisted\": true\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>You can as well follow the given url to view the results.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1629\" height=\"723\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli.png\" alt=\"Easy way to Test Internet Speed on Linux Terminal\" class=\"wp-image-14885\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli.png 1629w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-768x341.png 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-1536x682.png 1536w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-150x67.png 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-300x133.png 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-696x309.png 696w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-1068x474.png 1068w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/11\/internet-speedtest-linux-cli-946x420.png 946w\" sizes=\"(max-width: 1629px) 100vw, 1629px\" \/><\/figure>\n\n\n\n<p>And that is it on how you can test Internet Speed on Linux Terminal.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/installing-perf-performance-analysis-tool-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Installing Perf Performance Analysis Tool on CentOS 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/set-static-routes-via-an-interface-ip-on-centos-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Set Static Routes via an Interface\/IP on CentOS\/Ubuntu<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will show you an easy way to test Internet speed on Linux terminal. More often than not you might want to<\/p>\n","protected":false},"author":3,"featured_media":14885,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[63,121],"tags":[6108,6104,6105,6106,6107],"class_list":["post-14872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-networking","category-howtos","tag-centos-speedtest-terminal","tag-easy-way-to-test-internet-speed-on-linux-terminal","tag-install-speedtest-command-on-linux","tag-speedtest-cli-linux","tag-ubuntu-speedtest-terminal","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14872"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=14872"}],"version-history":[{"count":8,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14872\/revisions"}],"predecessor-version":[{"id":20651,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/14872\/revisions\/20651"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/14885"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=14872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=14872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=14872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}