我这里如下安装:
git clone https://github.com/sivel/speedtest-cli.git
python3 speedtest-cli/setup.py install【这个根据自己的版本来安装就可以了】
在speedtest-cli这个目录下可以如下操作:
python3 speedtest.py
Retrieving speedtest.net configuration...
Testing from China Telecom (1.84.212.150)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Xi'an branch,Chinaunicom (Xi'an) [19.75 km]: 18.86 ms
Testing download speed................................................................................
Download: 79.70 Mbit/s
Testing upload speed......................................................................................................
Upload: 21.90 Mbit/s
其实这个speedtest.py也就是脚本了
可以直接如下:
cp speedtest.py speedtest➜ speedtest-cli git:(master) ✗ chmod 755 speedtest-cli.1➜ speedtest-cli git:(master) ✗ chmod 755 speedtest➜ speedtest-cli git:(master) ✗ ./speedtestRetrieving speedtest.net configuration...Testing from China Telecom (1.84.212.150)...Retrieving speedtest.net server list...Selecting best server based on ping...Hosted by China Unicom Lanzhou Branch Co.Ltd (Lanzhou) [483.74 km]: 24.266 msTesting download speed................................................................................Download: 96.11 Mbit/sTesting upload speed................................................................................................Upload: 21.86 Mbit/s
其实默认下载之后的介绍很详细了
Versions--------speedtest-cli works with Python 2.4-3.7.. image:: https://img.shields.io/pypi/pyversions/speedtest-cli.svg :target: https://pypi.python.org/pypi/speedtest-cli/ :alt: VersionsInstallation------------pip / easy_install~~~~~~~~~~~~~~~~~~~:: pip install speedtest-clior:: easy_install speedtest-cliGithub~~~~~~:: pip install git+https://github.com/sivel/speedtest-cli.gitor:: git clone https://github.com/sivel/speedtest-cli.git cd speedtest-cli python setup.py installJust download (Like the way it used to be)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~:: wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py chmod +x speedtest-clior:: curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py chmod +x speedtest-cliUsage-----:: $ speedtest-cli -h usage: speedtest-cli [-h] [--no-download] [--no-upload] [--single] [--bytes] [--share] [--simple] [--csv] [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json] [--list] [--server SERVER] [--exclude EXCLUDE] [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] [--secure] [--no-pre-allocate] [--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 --no-download Do not perform download test --no-upload Do not perform upload test --single Only use a single connection instead of multiple. This simulates a typical file transfer. --bytes Display values in bytes instead of bits. Does not affect the image generated by --share, nor output from --json or --csv --share Generate and provide a URL to the speedtest.net share results image, not displayed with --csv --simple Suppress verbose output, only show basic information --csv Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by --bytes --csv-delimiter CSV_DELIMITER Single character delimiter to use in CSV output. Default "," --csv-header Print CSV headers --json Suppress verbose output, only show basic information in JSON format. Speeds listed in bit/s and not
另外感兴趣的可以看下Linux下的axel多进程下载,将本地带宽抛满很好的测试工具。