1、查看本機是否安裝pip工具:
pip3 -V
2、通過pip安裝speedtest-cli:
pip3 install speedtest-cli
3、接着安裝wget工具
brew install wget
4、首先要用wget命令從github上下來Python腳本:
wget https://github.com/sivel/speedtest-cli/archive/master.zip
5、解壓提取下載的文件(master.zip):
unzip master.zip
6、進入提取出的目錄speedtest-cli-master
cd speedtest-cli-master
7、篩選出洛杉磯的服務器ID:
python3 speedtest.py --list|grep Angeles
8、測試到服務器ID的上傳速度與下載速度:
python3 speedtest.py --server 14236
——————————————————————————————————————————————————————————————
參考博客:https://linux.cn/article-5626-1.html
via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/
作者:Avishek Kumar 譯者:NearTan 校對:wxy