speedtest命令行linux,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) ✗ ./speedtest

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 China Unicom Lanzhou Branch Co.Ltd (Lanzhou) [483.74 km]: 24.266 ms

Testing download speed................................................................................

Download: 96.11 Mbit/s

Testing 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: Versions

Installation------------pip / easy_install~~~~~~~~~~~~~~~~~~~::

pip install speedtest-clior:: easy_install speedtest-cliGithub~~~~~~::

pip install git+https://github.com/sivel/speedtest-cli.git

or

::

git clone https://github.com/sivel/speedtest-cli.git

cd speedtest-cli

python setup.py install

Just download (Like the way it used to be)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/mas

ter/speedtest.py

chmod +x speedtest-cli

or

::

curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/ma

ster/speedtest.py

chmod +x speedtest-cli

Usage

-----

::

$ 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

00bc355f322f1e2995a4320d19d701a3.png

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值