ping
[[email protected] /]# ping www.baidu.com PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data. 64 bytes from 61.135.169.121: icmp_seq=1 ttl=128 time=71.7 ms 64 bytes from 61.135.169.121: icmp_seq=2 ttl=128 time=72.1 ms 64 bytes from 61.135.169.121: icmp_seq=3 ttl=128 time=133 ms 64 bytes from 61.135.169.121: icmp_seq=4 ttl=128 time=119 ms ^C --- www.a.shifen.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3676ms rtt min/avg/max/mdev = 71.735/99.181/133.310/27.659 ms
与Windows环境下ping不同,Linux环境下,如果不按Ctrl+C会一直ping下去。Windows ping只发4个数据包完事。
ttl生存时间,每过一个路由器ttl减一,ttl为0时就停止转发。这样可以防止数据包在网络上无限转发。
rtt代表往返时间
mdev代表(Mean Deviation)平均偏差,表示这些 ICMP 包的 RTT 偏离平均值的程度,这个值越大说明你的网速越不稳定。
-c 指定发送几个数据包
[[email protected] /]# ping 8.8.8.8 -c4 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=73.9 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=82.1 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=119 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=137 ms --- 8.8.8.8 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3146ms rtt min/avg/max/mdev = 73.913/103.372/137.647/26.263 ms
-W 指定等待几秒钟 发送一个ping包
-w ping命令执行时间
-t 指定数据包TTL
原文地址:https://www.cnblogs.com/kelamoyujuzhen/p/9118510.html
时间: 2024-10-10 21:59:53