網頁

2023/6/13

Linux ping 發送次數

Linux ping指定封包發送次數的方式如下。


使用ping -c <times> <host>命令。
-c參數可指定次數,<times>為要發送的次數;
<host>為要發送封包的主機位址。

例如發送4次測試封包到google.com輸入ping -c 4 google.com

$ ping -c 4 google.com
PING google.com (142.251.130.14) 56(84) bytes of data.
64 bytes from hkg07s54-in-f14.1e100.net (142.251.130.14): icmp_seq=1 ttl=112 time=1.33 ms
64 bytes from hkg07s54-in-f14.1e100.net (142.251.130.14): icmp_seq=2 ttl=112 time=1.38 ms
64 bytes from hkg07s54-in-f14.1e100.net (142.251.130.14): icmp_seq=3 ttl=112 time=1.36 ms
64 bytes from hkg07s54-in-f14.1e100.net (142.251.130.14): icmp_seq=4 ttl=112 time=1.35 ms

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 1.332/1.355/1.382/0.018 ms


沒有留言:

張貼留言