Debian 使用 Speedtest CLI 进行测速
创作时间:
作者:
@小白创作中心
Debian 使用 Speedtest CLI 进行测速
引用
CSDN
1.
https://blog.csdn.net/xiangmuxs/article/details/139125158
本文将指导如何在Debian 11和Ubuntu 22.04下安装并使用Speedtest CLI进行测速。Speedtest CLI是Ookla官方推出的Linux/ BSD下的CLI工具,方便我们在服务器里直接测试公网带宽速度。
安装Speedtest CLI
首先,导入GPG Key并添加源:
apt install -y lsb-release ca-certificates apt-transport-https curl gnupg dpkg
curl -sSL https://packagecloud.io/ookla/speedtest-cli/gpgkey | gpg --dearmor > /usr/share/keyrings/speedtest.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/speedtest.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/speedtest.list
然后更新系统并安装speedtest:
apt update
apt install speedtest -y
使用Speedtest CLI
安装完毕后我们即可使用默认的speedtest命令选择最近的节点并使用默认的网络测速,提示"Do you accept the license? [type YES to accept]"时,输入YES并回车即可。
高级用法
输入speedtest -h即可查看speedtest的命令参数:
root@debian ~ # speedtest -h
Speedtest by Ookla is the official command line client for testing the speed and performance of your internet connection.
Version: speedtest 1.1.1.28
Usage: speedtest [<options>]
-h, --help Print usage information
-V, --version Print version number
-L, --servers List nearest servers
-s, --server-id=# Specify a server from the server list using its id
-I, --interface=ARG Attempt to bind to the specified interface when connecting to servers
-i, --ip=ARG Attempt to bind to the specified IP address when connecting to servers
-o, --host=ARG Specify a server, from the server list, using its host's fully qualified domain name
-p, --progress=yes|no Enable or disable progress bar (Note: only available for 'human-readable'
or 'json' and defaults to yes when interactive)
-P, --precision=# Number of decimals to use (0-8, default=2)
-f, --format=ARG Output format (see below for valid formats)
--progress-update-interval=# Progress update interval (100-1000 milliseconds)
-u, --unit[=ARG] Output unit for displaying speeds (Note: this is only applicable
for ‘human-readable’ output format and the default unit is Mbps)
-a Shortcut for [-u auto-decimal-bits]
-A Shortcut for [-u auto-decimal-bytes]
-b Shortcut for [-u auto-binary-bits]
-B Shortcut for [-u auto-binary-bytes]
--selection-details Show server selection details
--ca-certificate=ARG CA Certificate bundle path
-v Logging verbosity. Specify multiple times for higher verbosity
--output-header Show output header for CSV and TSV formats
Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty
Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision
Valid units for [-u] flag:
Decimal prefix, bits per second: bps, kbps, Mbps, Gbps
Decimal prefix, bytes per second: B/s, kB/s, MB/s, GB/s
Binary prefix, bits per second: kibps, Mibps, Gibps
Binary prefix, bytes per second: kiB/s, MiB/s, GiB/s
Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes
比较实用的有:
- 指定出口网卡:
speedtest -I 指定网卡名称 - 指定出口IP:
注意指定网卡或IP后可能会出现"[error] Error: [0] Cannot open socket"的错误提示,忽略即可。speedtest -i IP 地址 - 查看附近的测速节点列表:
speedtest -L - 指定某个测速节点:
speedtest -s 测速节点ID
最后秀一下我们的40Gbps公网带宽服务器:
热门推荐
胃肠镜检查的“麻烦”如何化解?
电动牙刷示范巴氏刷牙法的正确步骤,这个方法你确定不来学习?
霍去病的父亲抛弃他们母子,霍去病为何还要与他相认,给他养老?
股市封单对市场流动性有什么影响?投资者在这一情况下应如何应对?
口水疹的处理方法
境外旅游个人险购买指南:价格、选择要点与注意事项全解析
境外旅游个人险要多少钱 出国旅游怎么买意外险
春季,成了口腔溃疡的“春天”?为什么容易溃疡?如何预防和治疗
益生菌在皮肤中的机制与应用研究
劳动之赞:赞美劳动者的伟大与价值
初恋到底会给一个人带来多大改变?
FDTD软件教程:从入门到精通
寒假里手机怎么管?家长,你需要一份科学行动指南
精氨酸:一种多功能的健康补充剂
适合室内做的有氧运动有哪些
短剧如何通过数据分析优化推广效果
美国大学文书申请的未来展望
用随机森林预测在线购物者的购买意向
南宁特色美食:九种地道佳肴,尽显广西首府饮食文化魅力
社交圈的重要性:如何选择积极影响你的朋友与团队
杨妙真:古代女将的武艺传奇
在职研究生如何协调复习时间
声带息肉七问七答:长了声带息肉,一定要手术吗?
不同品种菊花茶大揭秘,口感、功效与选购指南
法定救助义务、连带担保与免责事由详解
市场情绪的解读与应用:如何解读市场情绪并应用于交易
亚洲移动社交三巨头“微信、LINE、Kakao”,这些年的相爱相杀
人工智能与数据分析深度融合:智能决策的未来已来!
交通事故全责方理赔流程及撞死人赔偿标准详解
蕨麻的功效与作用