简介
“Ping” 是一种网络诊断命令,常用于测试网络连接。Ping 通过发送 ICMP ECHO_REQUEST 到目标主机,并等待接收 ICMP ECHO_REPLY
来确定目标主机是否可达。Ping 命令通常用于检查网络连接是否正常,或者诊断网络故障。
gping是一个基于Rust编写的可视化工具,可以实时查看网络连通情况。它是一个跨平台的命令行程序,当用户尝试ping主机或网站时,
该程序会在终端内部显示漂亮的图形。
安装
Linux
1、wget https://github.com/orf/gping/releases/download/gping-v1.14.0/gping-Linux-x86_64.tar.gz
2、tar xvf gping-Linux-x86_64.tar.gz
3、mv gping /usr/local/bin
windows
1、https://github.com/orf/gping/releases/download/gping-v1.8.0/gping-Windows-x86_64.zip
2、将可执行文件放入C:/Windows目录下
使用
Usage: gping [OPTIONS] [HOSTS_OR_COMMANDS]...
Arguments:
[HOSTS_OR_COMMANDS]... Hosts or IPs to ping, or commands to run if --cmd is provided. Can use cloud shorthands like aws:eu-west-1.
Options:
--cmd
Graph the execution time for a list of commands rather than pinging hosts
-n, --watch-interval <WATCH_INTERVAL>
Watch interval seconds (provide partial seconds like '0.5'). Default for ping is 0.2, default for cmd is 0.5.
-b, --buffer <BUFFER>
Determines the number of seconds to display in the graph. [default: 30]
-4
Resolve ping targets to IPv4 address
-6
Resolve ping targets to IPv6 address
-i, --interface <INTERFACE>
Interface to use when pinging
-s, --simple-graphics
Uses dot characters instead of braille
--vertical-margin <VERTICAL_MARGIN>
Vertical margin around the graph (top and bottom) [default: 1]
--horizontal-margin <HORIZONTAL_MARGIN>
Horizontal margin around the graph (left and right) [default: 0]
-c, --color <color>
Assign color to a graph entry.
This option can be defined more than once as a comma separated string, and the
order which the colors are provided will be matched against the hosts or
commands passed to gping.
Hexadecimal RGB color codes are accepted in the form of '#RRGGBB' or the
following color names: 'black', 'red', 'green', 'yellow', 'blue', 'magenta',
'cyan', 'gray', 'dark-gray', 'light-red', 'light-green', 'light-yellow',
'light-blue', 'light-magenta', 'light-cyan', and 'white'
--clear
Clear the graph from the terminal after closing the program
-h, --help
Print help
-V, --version
Print version
运行
gping baidu.com