如何在Linux终端中测试宽带速度
要安装速度测试CLI命令行,需要使用 Python ppi 。使用以下命令安装 Python ppi 。
$ sudo apt-get install python-pip
样例输出应该如下所示—
构建依赖树
正在读取状态信息...完成
以下软件包已自动安装,不再需要:
libbs2b0 libopusfile0 libqmmp-misc libqmmpui0 libsidplayfp
linux-headers-4.2.0-27 linux-headers-4.2.0-27-generic
linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic
linux-signed-image-4.2.0-27-generic php7.0-opcache
使用'apt-get autoremove'来移除它们。
还将安装以下额外的软件包:
python-chardet-whl python-colorama python-colorama-whl python-distlib
python-distlib-whl python-html5lib python-html5lib-whl python-pip-whl
python-requests-whl python-setuptools python-setuptools-whl python-six-whl
python-urllib3-whl python-wheel
建议安装以下软件包:
python-genshi
推荐安装以下软件包:
python-dev-all
以下新软件包将被安装:
python-chardet-whl python-colorama python-colorama-whl python-distlib
.............................................................................
要安装 speedtest-cli ,使用以下命令—
$ sudo pip install speedtest-cli
样例输出应该如下所示—
正在下载/解包 speedtest-cli
正在下载 speedtest_cli-0.3.4-py2.py3-none-any.whl
正在安装收集到的软件包:speedtest-cli
成功安装了 speedtest-cli
清理...
要运行Speedtest-cli,请使用以下命令—
$ speedtest-cli
样例输出应该如下所示—
正在检索speedtest.net配置...
正在检索speedtest.net服务器列表...
从Beam电信 (183.82.104.71) 测试...
基于延迟选择最佳服务器...
ACT Fibernet (Hyderabad) 的主机 [10.33 km]: 2.75 毫秒
测试下载速度........................................
下载: 23.32 Mbit/s
测试上传速度..................................................
上传: 14.30 Mbit/s
要获取有关 speedtest-cli 的更多信息,请使用以下命令—
$ speedtest-cli --help
样例输出应该如下所示—
usage: speedtest-cli [-h] [--bytes] [--share] [--simple] [--list]
[--server SERVER] [--mini MINI] [--source SOURCE]
[--timeout TIMEOUT] [--secure] [--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
--bytes Display values in bytes instead of bits. Does not affect the image generated by --share
--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
--timeout TIMEOUT HTTP timeout in seconds. Default 10
--secure Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
--version Show the version number and exit
恭喜!现在,您知道了“如何在Linux终端中测试宽带速度”。我们将在接下来的Linux文章中学习更多关于这些类型命令的知识。请继续阅读!
更多Python相关文章,请阅读:Python 教程