Linux下使用Speedtest测试网速教程

文章目录:

  • 一、通过Speedtest官网直接测试网络速度
  • 二、通过下载源码,在命令行中测试网速
    • 1、下载安装
    • 2、Speedtest的参数使用:

有时候我们会需要测试一下当前本机的下载速度和上行速度,但是不行,Linux并没有自带这种技能,那就只能借助外力get此技能啦!!!


这里我们使用的是Speedtest工具,下面介绍该工具的两种测试网速的方法

  • 通过浏览器测试网速
  • 通过下载源码,在命令行中测试网速

一、通过Speedtest官网直接测试网络速度

  1. Speedtest的官方网址
    网址: https://www.speedtest.net/

通过浏览器打开该网址,点击Go 即可开启网速测试之旅

2、测试效果如下:

二、通过下载源码,在命令行中测试网速

这里用到一个Python工具speedtest,speedtest是一个用Python编写的轻量级Linux命令行工具,目前支持几乎所有的python版本Python 2.4-3.7。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest很简单——只需要下载其Python脚本文件。

1、下载安装

Speedtest的github的下载地址:

https://github.com/sivel/speedtest-cli

Speedtest有多种安装方式,选一种你喜欢的方式去安装它吧!方法如下:

  1. 直接用pip安装
pip install speedtest-cli
  1. 用easy_install 安装
easy_install speedtest-cli
  1. 用pip结合git下载安装
pip install git+https://github.com/sivel/speedtest-cli.git
  1. 用git先下载,然后在用python执行安装程序安装
git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py install
  1. 用wget下载,不安装
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
  1. 用curl下载,不安装
curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli

2、Speedtest的参数使用:

$ speedtest-cli -husage: speedtest-cli [-h] [--no-download] [--no-upload] [--bytes] [--share][--simple] [--csv] [--csv-delimiter CSV_DELIMITER][--csv-header] [--json] [--list] [--server SERVER][--exclude EXCLUDE] [--mini MINI] [--source SOURCE][--timeout TIMEOUT] [--secure] [--no-pre-allocate][--version]Command line interface for testing internet bandwidth using speedtest.net.
-https://github.com/sivel/speedtest-clioptional arguments:-h, --help            show this help message and exit--no-download         Do not perform download test--no-upload           Do not perform upload test--bytes               Display values in bytes instead of bits. Does notaffect the image generated by --share, nor output from--json or --csv--share               Generate and provide a URL to the speedtest.net shareresults image, not displayed with --csv--simple              Suppress verbose output, only show basic information--csv                 Suppress verbose output, only show basic informationin CSV format. Speeds listed in bit/s and not affectedby --bytes--csv-delimiter CSV_DELIMITERSingle character delimiter to use in CSV output.Default ","--csv-header          Print CSV headers--json                Suppress verbose output, only show basic informationin JSON format. Speeds listed in bit/s and notaffected by --bytes--list                Display a list of speedtest.net servers sorted bydistance--server SERVER       Specify a server ID to test against. Can be suppliedmultiple times--exclude EXCLUDE     Exclude a server from selection. Can be suppliedmultiple times--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 withspeedtest.net operated servers--no-pre-allocate     Do not pre allocate upload data. Pre allocation isenabled by default to improve upload performance. Tosupport systems with insufficient memory, use thisoption to avoid a MemoryError--version             Show the version number and exit

Reference:
1、https://blog.csdn.net/catoop/article/details/50350623
2、https://linux.cn/article-9558-1.html
3、https://blog.csdn.net/wh211212/article/details/52735229
4、https://blog.csdn.net/h952520296/article/details/78458072




♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠ ⊕ ♠

Linux下使用Speedtest测试网速教程相关推荐

  1. Linux下使用Speedtest测试网速

    导读 Speedtest是用来测试网络性能的开源软件,在Linux下面安装Speedtest可以用来测试网络出口的上传和下载速度,帮助排查网络方面导致的故障. Speedtest介绍 由于公司几个项目 ...

  2. linux用ping命令测试网速,linux下面使用命令测试网速

    大家都知道在speedtest是市面上最准确最全面的测速工具,但在linux命令行不能直接使用,所以我们就借助脚本调用speedtest的接口来利用他测试网速. 1.下载speedtest-cli脚本 ...

  3. linux下限制每个IP网速

    需求是要限制每个ip单独网速为100kb,服务器在阿里云上,专有网络网卡只有eth0 linux下限制网速的方法有很多种 1.wondershaper # 是一根据网卡来进行限制总网速,操作简单,适合 ...

  4. linux 脚本 上网限制,Linux_Ubuntu下限制局域网网速教程,为了限制无线路由器上大家的 - phpStudy...

    Ubuntu下限制局域网网速教程 为了限制无线路由器上大家的上网速度,减少p2p工具的影响 可以通过arp欺骗和iptables来限制局域网的上网速度 操作系统:Ubuntu 1)sudo apt-g ...

  5. centos 测试网速(speedtest)

    很多时候我们需要测试Linux服务器的上行和下行宽带.在可用于测试宽带速度的网站中,Speedtest.net也许是使用最广泛的应用"之一".  Speedtest.net提供了一 ...

  6. 使用Linux命令行测试网速

    2019独角兽企业重金招聘Python工程师标准>>> Speedtest.net的工作原理并不复杂:它在你的浏览器中加载JavaScript代码并自动检测离你最近的Speedtes ...

  7. python测网速_使用Linux命令行测试网速(示例代码)

    当发现上网速度变慢时,人们通常会先首先测试自己的电脑到网络服务提供商(通常被称为"最后一公里")的网络连接速度.在可用于测试宽带速度的网站中,Speedtest.net也许是使用最 ...

  8. linux服务器如何测试网速

    linux服务器如何测试网速 说到测网速我相信很多小伙伴都知道在自己的电脑上操作,但我们平时用的比较多的系统还是Windows系统,那么到了linux系统上你知道怎么测网速吗? 今天还是艾西的服务器小 ...

  9. Linux命令行测试网速

    很多时候我们需要测试Linux服务器的上行和下行宽带.在可用于测试宽带速度的网站中,Speedtest.net也许是使用最广泛的应用"之一". Speedtest.net提供了一个 ...

最新文章

  1. testem方便的web tdd 测试框架使用
  2. Android aidl 正确使用 callback的方式
  3. 每日一皮:2020年度最佳微小说...
  4. bogofilter 使用
  5. 【转载】分布式数据库架构--分库、分表、排序、分页、分组、实现
  6. 解析Integer比较
  7. Process when we start our testing work
  8. 区块链 以太坊 每个区块可以包含多少个交易
  9. AdaBoost(1)
  10. julia的几种画图方法
  11. WiFi 802.11可调参数说明---信标间隔(Beacon Interval)
  12. APP上传照片后台实现方法
  13. QQ透明头像通用设置教程!不仅简单而且免费!
  14. [ Linux ] PCF8563数据手册解析 |CSDN创作打卡
  15. 《交互式程序设计 第2版》一1.2 交互领域中的编程
  16. 错误处理(包括日志记录)
  17. 数据库原理——T-SQL、游标
  18. OUC_软件工程_BLOG1
  19. 金山WPS升级后导致用友输出Excel表格打不开
  20. python文件开头# coding=gbk的用途

热门文章

  1. [poj] 2318 TOYS || 判断点在多边形内
  2. 嵌入式linux下如何尽快播放开机音乐
  3. HDU-1316 How Many Fibs? Java
  4. 如何为WCF应用添加X509证书和安全验证
  5. Windows Phone + VB 程序员=好的移动应用程序
  6. sql,nolock
  7. lucene.net 某些类的介绍
  8. iview构建基本html页面,使用vue-cli创造基于vue.js的iview工程
  9. python100个必背知识-python编程面试中必考的知识点,数据类型全解,笔记超全面...
  10. 学习python是干嘛的-学 Python 都用来干嘛的?