1 、安裝 speedtest-cli
speedtest-cli 是一個用 Python 編寫的輕量級 Linux 命令列工具,在 Python2.4 至 3.4 版本下均可執行。它基於 Speedtest.net 的基礎架構來測量互聯網的上/下行速率。安裝 speedtest-cli 很簡單——只需要下載其 Python 指令碼檔案。

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–cli
sudo chown root:root /usr/local/bin/speedtest–cli

2 、使用 speedtest-cli 測試網速使用 speedtest-cli 命令也很簡單,它不需要任何引數即可工作。

speedtest-cli

複製程式碼
輸入這個命令後,它會自動發現離你最近的 Speedtest.net 站羣服務器(地理距離),然後列印出測試的互聯網上/下行速率。

如果你願意分享測試結果,你可以使用引數 “–share” 。它將會把你的測試結果上傳到 Speedtest.net 站羣服務器並以圖形的方式分享給其他人。