Easy and Fast Way to SpeedTest in Linux Terminal | Speedtest.net

speedtest

On this occasion, I actually just played it for fun, because every day I use the GNU/Linux OS and often do internet connection tests, the thought arises, “How is it easy and fast to speedtest in Linux Terminal?” what is the command?

Searching for a while, found a way. This speedtest command is the same when you do a speedtest on the speedtest.net site

Please just copy and paste:

$wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
$ chmod a+rx speedtest_cli.py
$ sudo mv speedtest_cli.py /usr/local/bin/speedtest
$ sudo chown root:root /usr/local/bin/speedtest

When finished, you can freely do a speedtest without having to open a browser and wait for the display to load. Just stay in the terminal:

[email protected]:~$ speedtest
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from PT Telkom Indonesia (36.73.99.16)…
Selecting best server based on latency…
Hosted by CitraNet (Surakarta) [52.45 km]: 31,874 ms
Testing download speed………………………………………..
Downloads: 3.36 Mbit/s
Testing upload speed……………………………………………………… …
Uploads: 0.62 Mbit/s

Besides you can see the speedtest you can also see the Public IP of your network.
In addition, if you want to do a speed test to another IP Address Server, you must know the IP Address server code. To find out the server code you have to execute one more command like this:

[email protected]:~$ speedtest –list | more
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
8042) UNY (Yogyakarta, Indonesia) [11.63 km]
7106) GMedia Technologies (Yogyakarta, Indonesia) [11.63 km]
6910) CitraNet (Yogyakarta, Indonesia) [11.63 km]
7301) CitraNet (Surakarta, Indonesia) [52.45 km]
8105) Semarang State University (Semarang, Indonesia) [81.44 km]
7127) GMedia Technologies (Semarang, Indonesia) [81.44 km]
7195) GMedia Technologies (Malang, Indonesia) [251.01 km]
2233) PT. Telecommunications Indonesia (Surabaya, Indonesia) [266.06 km]

The command above is how to find out the speedtest server code, after you find the server code you want to test speed, how to do a speed test to the server is as follows:

First select the destination server for your speed test. For example, here I want to speedtest to Orion Cyber ​​Internet in Bandung.

7409) Orion Cyber ​​Internet, PT (Bandung, Indonesia)

Then type the command below:

[email protected]:~$ speedtest –server 7409
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Testing from PT Telkom Indonesia (36.73.99.16)…
Hosted by Orion Cyber ​​Internet, PT (Bandung) [316.45 km]: 726,119 ms
Testing download speed………………………………………..
Downloads: 2.18 Mbit/s
Testing upload speed……………………………………………………… …
Uploads: 0.60 Mbit/s

The speed test was successful. Good luck…

Troubleshoot:
If you find an error code like the one below, please repeat your speedtest command.

[email protected]:~$ speedtest –server 7409
Retrieving speedtest.net configuration…
Retrieving speedtest.net server list…
Traceback (most recent call last):
File “/usr/local/bin/speedtest”, line 796, in
main()
File “/usr/local/bin/speedtest”, line 790, in main
speedtest()
File “/usr/local/bin/speedtest”, line 631, in speedtest
servers = closestServers(config[‘client’], True)
File “/usr/local/bin/speedtest”, line 436, in closestServers
serversxml.append(uh.read(10240))
File “/usr/lib/python2.7/socket.py”, line 384, in read
data = self._sock.recv(left)
File “/usr/lib/python2.7/httplib.py”, line 612, in read
s = self.fp.read(amt)
File “/usr/lib/python2.7/socket.py”, line 384, in read
data = self._sock.recv(left)
socket.timeout: timed out