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公网带宽服务器:
热门推荐
吕姓宝宝起名大揭秘:这些名字火遍全网!
人中吕布,马中赤兔:吕姓英雄传奇
永福股份倍量选股实战:从80元跌至40元后的反转机会
8.5时间旅行
时间的本质:哲学与科学的探索
两来风:一碗辣汤,一个煎包,一座城的味觉记忆
丁腈手套:环保安全的防护新选择
一次性手套:抗疫必备神器
杂谈诗词拗救
千年古方焕新颜:吉林敖东龟芪参口服液的传承与创新
龟芪参口服液:传统宫廷秘方的现代医学新解
如何正确拆洗汽车空调以保持良好使用效果?拆洗时有哪些注意事项?
汽车空调内循环出现异味怎么办?6个实用解决方案
自然语言处理:AI与人类对话的艺术
减肥成功后,如何科学过渡,避免反弹?
阿尔伯特·班杜拉教你如何培养自信心态
健身真的能让人更自信吗?
积极心理学:10个方法助你提升自信
职场口才培训:提升沟通能力的关键途径
职场沟通技巧大揭秘:如何提升自信心?
周杰伦新专辑引爆全网:版权大战背后的经济利益
周杰伦新歌引爆全网,你最爱哪个平台?
周杰伦版权大战:从独家垄断到开放竞争
职场避谈工资的高情商技巧:既不得罪人,又保护隐私
别将自己活成一座孤岛:疫情后的心理健康守护指南
MELiSSA:太空殖民的生命保障神器
青海彩民中1938万:双色球的奇迹之夜
什么叫过桥资金?这种资金在企业运营中有什么作用?
羁绊进化与Mega进化全面解析:优缺点对比与应用场景探讨
王菲新歌爆火!《世界赠予我的》里藏着多少人生答案?