安装speedtest-cli
speedtest-cli是一个用Python编写的轻量级Linux命令行工具,在Python2.4至3.4版本下均可运行。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest-cli很简单——只需要下载其Python脚本文件。
[root@localhost ~]# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
[root@localhost ~]# chmod +rx speedtest.py
[root@localhost ~]# mv speedtest.py /usr/local/bin/speedtest-cli
[root@localhost ~]# chown root:root /usr/local/bin/speedtest-cli
使用speedtest-cli测试网速
[root@localhost ~]# speedtest-cli
输入这个命令后,它会自动发现离你最近的Speedtest.net服务器(地理距离),然后打印出测试的网络上/下行速率。
[root@localhost ~]# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Topway Global Limited ...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 1010 (Wan Chai) [2.24 km]: 9.427 ms
Testing download speed................................................................................
Download: 96.07 Mbit/s
Testing upload speed................................................................................................
Upload: 93.58 Mbit/s
文章来源:https://www.cnaaa.net,转载请注明出处:https://www.cnaaa.net/archives/5160