A trick to teach you how to test network speed under Linux command line

foreword

When people usually use computers and mobile phones to surf the Internet, the speed of the network is often the indicator you are most concerned about, and we generally use professional network speed test software to judge the quality of the network according to the test data. Then this article will introduce the network speed measurement tool under the Linux command line, so that you can know your network speed at any time!
insert image description here

environment

Virtual Machine: Vmware 15
System: Centos 7


Speedtest

I believe everyone is familiar with this network test software. We usually use this software when testing network speed.
insert image description here

Introducing Speedtest CLI

Speedtest CLI brings the trusted technology and global server network behind Speedtest to the command line. Built for software developers, sysadmins, and computer hobbyists alike, Speedtest CLI is the first official Linux-native Speedtest application powered by Ookla®.

CLIThat is ( command-line interface, command line interface) refers to the interface that can enter executable instructions at the user prompt, it usually does not support the mouse, the user enters the instruction through the keyboard, and the computer executes the instruction after receiving the instruction.

The official website also introduces the operation of Speedtest:

  • Measure Internet connection performance metrics such as downloads, uploads, latency, and packet loss locally without relying on a web browser
  • Use to Speedtest Server Network™test Raspberry Pi®the internet connection of low-power devices like Linux desktops, remote servers, and even
  • Set up automated scripts to collect connection performance data, including trends over time
  • SpeedtestWrap it up and use it in your own program in the programming language of your choice
  • Pass CSV, JSONLor JSONView test results

Install the CLI version of Speedtest

Switch to the root user, enter su and press Enter and then enter the root user password.

su

Download the installation script

curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash

Waiting for download...
insert image description here
wait for the prompt The repository is setup! You can now install packages.to download OK
insert image description here

install speedtest

sudo yum install speedtest -y

Appears to Completeindicate that the installation is complete
insert image description here

Speedtest test network

The speedtest command will directly provide upload/download rates and latency packet loss rates

speedtest

insert image description here

注意:测试单位不是MB/s而是Mbps,MB/s是Mbps的8倍

insert image description here

Other functions can be viewed with --help

speedtest --help

insert image description here
For example to see a list of recent services

speedtest -L

insert image description here

The end of the tutorial~

Guess you like

Origin blog.csdn.net/qq_31762741/article/details/122370346