CentOS 使用speedtest命令行测试网速

安装speedtest-cli

speedtest-cli是一个用Python编写的轻量级Linux命令行工具,在Python2.4至3.4版本下均可运行。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest-cli很简单——只需要下载其Python脚本文件。

[root@localhost ~]# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
[root@localhost ~]# chmod +rx speedtest.py
[root@localhost ~]# mv speedtest.py /usr/local/bin/speedtest-cli
[root@localhost ~]# chown root:root /usr/local/bin/speedtest-cli

使用speedtest-cli测试网速

[root@localhost ~]# speedtest-cli

输入这个命令后,它会自动发现离你最近的Speedtest.net服务器(地理距离),然后打印出测试的网络上/下行速率。

[root@localhost ~]# speedtest-cli
Retrieving speedtest.net configuration...
Testing from Topway Global Limited ...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by 1010 (Wan Chai) [2.24 km]: 9.427 ms
Testing download speed................................................................................
Download: 96.07 Mbit/s
Testing upload speed................................................................................................
Upload: 93.58 Mbit/s

文章来源:https://www.cnaaa.net,转载请注明出处:https://www.cnaaa.net/archives/5160

(0)
郭靖的头像郭靖
上一篇 2022年6月25日 下午6:08
下一篇 2022年6月30日 下午6:50

相关推荐

  • ansible基础用法

    今天需要同时对200+机器进行操作,使用ansible进行处理 首先使用的是ubuntu22.04的机器,一键安装ansible 安装完成后,需要对ansible.cfg配置文件进行修改,在当前目录下,新建 ansible.cfg 文件 配置文件完成后,需要创建hosts主机组,新建 hosts 文件 最后进行机器验证 这样就说明,你的ansible主机可以…

    2023年11月7日
    1.4K00
  • 解决CentOS lspci(command not found)方法

    今日需要查看一台机器的显卡型号,但未安装驱动,只能通过lspci 进行查询 在进行CentOS最小化安装后,会发现lspci命令不好使。其实是因为相应的软件包没有安装。在终端中执行下列命令: 将会得到如下的显示内容 在终端中输入 安装后,即可正常使用lspci了。 查看显卡信息: 然后就可以参照型号下载显卡驱动了

    2024年5月6日
    1.7K00
  • CentOS7单用户修改密码

    重启开机  按‘e’进入编辑模式 在下边 编辑修改两处:ro改为rw,在LANG=en_US.UFT-8后面添加 init=/bin/sh 按Ctrl+x 重启进入单用户,修改密码 由于selinux开启着的需要执行以下命令更新系统信息,否则重启之后密码未生效 重启系统

    2023年6月12日
    1.2K00
  • 安装linux/Centos系统出现An Unknown Error Has Occurred报错原因和解决方法

    今天在给一个客户重装系统的时候出现: An Unknown Error Has OccurredThis program has encountered an unknown error. You may report the buy below or quit the program. This program has encountered an unk…

    2024年1月22日
    2.2K00
  • 在Linux系统内启动某个服务时提示task: Cannot allocate memory该如何处理?

    问题现象 在ECS实例中启动某个服务进程时,系统提示task: Cannot allocate memory错误,如下图所示。 可能原因 可能是系统进程数超限导致。 Linux内核通过内核配置参数kernel.pid_max限制进程的数量,当运行的服务的总进程数超出kernel.pid_max的值时,再创建新进程时系统会报错task: Cannot allo…

    2023年11月14日
    1.1K00

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

在线咨询: QQ交谈

邮件:712342017@qq.com

工作时间:周一至周五,8:30-17:30,节假日休息

关注微信