How To Install Speedtest-cli On a CentOS-八零岁月
记录所见
分享所感

How To Install Speedtest-cli On a CentOS

Step 1: Install python

Type the following yum command to install Python on a CentOS/RHEL/Scientific Linux:
$ sudo yum install python
Type the following dnf command to install Python on a Fedora Linux v22+:
$ sudo dnf install python

Step 2: Download speedtest_cli.py

Type the following wget command to grab the speedtest_cli.py client:
$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
$ chmod +x speedtest-cli

Step 3: Check the Internet speed

Simply type the following command:
$ ./speedtest-cli
OR
$ python speedtest-cli

To see speed values in bytes instead of bits pass the –bytes option:
$ ./speedtest-cli --bytes
To generate and provide a URL to the speedtest.net share results image pass the –share option:
$ ./speedtest-cli --share
Of course, you can combine both the options:
$ ./speedtest-cli --share --bytes

How do I specify a server ID to test against?

First, grab a server list, enter:
$ wget http://www.speedtest.net/speedtest-servers.php
To view a server ID, enter:
$ more speedtest-servers.php
To search a server ID, enter:
$ grep 'city-name' speedtest-servers.php
$ grep 'country-name' speedtest-servers.php
$ grep 'Tampa, FL' speedtest-servers.php

OR just display a server ID:
$ grep 'Tampa, FL' speedtest-servers.php | egrep -o 'id="[0-9]{4}"'
Sample outputs:

id="2137"
id="1296"

Next use the server ID 2137:
$ ./speedtest-cli --server 2137


文章转载请说明出处:八零岁月 » How To Install Speedtest-cli On a CentOS

分享到:更多 ()

吐槽集中营 抢沙发

评论前必须登录!