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公网带宽服务器:
热门推荐
保护牙齿健康的有效措施及预防蛀牙最佳方法
小金丹与小金丸:中药双杰的功效与选择
为什么说中医的不传之秘在于量?从如何“妙用”黄芪,或就能明白
原油期货与什么品种对冲?这些对冲策略如何应用?
李自成入京后的败亡之路
学术英语写作与演讲综合指南:结构、技巧与常见误区
艾尔登法环显卡用哪个划算
晚上喝醋有什么好处
西班牙留学签证材料清单(北京、广州、上海领区)
别再盲目比较,一文教会您如何判断宝宝身高、体重是否达标
从2025年开始,“尽快买房”还是“再等一等”?马云王石不谋而合
存量博弈与零和博弈的区别
零和博弈、正和博弈和负和博弈
免税的范围有哪些
雨中冒险2神器攻略图解大全:全面解析神器效果与使用技巧,助你轻松应对挑战
配置基金:优化投资组合的最佳选择技巧
盗窃罪与故意毁坏财物罪有什么区别
深圳多所中小学开设广东方言课程获点赞 粤来粤上头
蛋白减肥方法(减肥期间怎么补充蛋白质)
一种提升无人机小物体跟踪精度的方法
Transformer架构详解
sp0w16机油是什么?
2024年会计学专业全国大学排名:含最好的10所本科名校
经常做眼保健操有这些好处!
18种可以生吃的蔬菜
香砂六君丸慎用,是真的吗
个税申报系统与公积金中心规定不一致?官方回复来了
西安云计算薪资多少钱
玉米须的禁忌有哪些?3个玉米须禁忌早了解
吕嘉+国家大剧院管弦乐团,发行《布鲁克纳交响曲全集》