Linux或者Mac下命令行speedtest测试网络速度

【Linux或者Mac下命令行speedtest测试网络速度】我这里如下安装:
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.gitcd speedtest-clipython setup.py installJust download (Like the way it used to be)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~::wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.pychmod +x speedtest-clior::curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.pychmod +x speedtest-cliUsage-----::$ speedtest-cli -husage: 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-clioptional arguments:-h, --helpshow this help message and exit--no-downloadDo not perform download test--no-uploadDo not perform upload test--singleOnly use a single connection instead of multiple. Thissimulates a typical file transfer.--bytesDisplay values in bytes instead of bits. Does notaffect the image generated by --share, nor output from--json or --csv--shareGenerate and provide a URL to the speedtest.net shareresults image, not displayed with --csv--simpleSuppress verbose output, only show basic information--csvSuppress verbose output, only show basic informationin CSV format. Speeds listed in bit/s and not affectedby --bytes--csv-delimiter CSV_DELIMITERSingle character delimiter to use in CSV output.Default ","--csv-headerPrint CSV headers--jsonSuppress verbose output, only show basic informationin JSON format. Speeds listed in bit/s and not 

Linux或者Mac下命令行speedtest测试网络速度

文章插图
 
另外感兴趣的可以看下linux下的axel多进程下载,将本地带宽抛满很好的测试工具 。




    推荐阅读