CentOS下使用命令列測試網速
Speedtest.net提供了一個命令列工具 speedtest-cli我們可以在Linux中使用speedtest-cli來測試寬頻速度
speedtest-cli是由Python編寫的輕量級Linux命令列工具基於Speedtest.net的基礎架構來測量網路的上/下行速率
運行環境:Python2.4-3.4
github:https://github.com/sivel/speedtest-cli
下載speedtest-cli.py 並更改許可權# wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py# chmod a+rx speedtest_cli.py 使用speedtest-cli# speedtest-cli# 下方內容為回顯內容(整個過程需要花上一點時間)*****************************************************************Retrieving speedtest.net configuration...Retrieving speedtest.net server list...Testing from China Unicom ####### (0.0.0.0)...Selecting best server based on ping...Hosted by Vladlink (Vladivostok) [509.76 km]: 14.623 msTesting download speed........................................Download: 2.10 Mbit/sTesting upload speed..................................................Upload: 0.41 Mbit/s***************************************************************** # speedtest-cli -husage: speedtest-cli [-h] [--share] [--simple] [--list] [--server SERVER] [--mini MINI] [--source SOURCE] [--version] Command line interface for testing internet bandwidth using speedtest.net.-------------------------------------------------------------------------- https://github.com/sivel/speedtest-cli optional arguments: -h, --help show this help message and exit --share Generate and provide a URL to the speedtest.net share results image --simple Suppress verbose output, only show basic information --list Display a list of speedtest.net servers sorted by distance --server SERVER Specify a server ID to test against --mini MINI URL of the Speedtest Mini server --source SOURCE Source IP address to bind to --version Show the version number and exit #如果想方便的使用speedtest-cli 可以對speedtest-cli.py進行如下操作# sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli# sudo chown root:root /usr/local/bin/speedtest-cli