ping 命令中的 -U 选项有什么用途?

ping 命令中的 -U 选项有什么用途?

我正在学习 ping 命令及其选项。

在 ping 中,-U 选项用于完整的用户到用户延迟。

ping 和 ping -U 选项的输出没有区别。

$ ping google.com
PING google.com (216.58.199.174) 56(84) bytes of data.
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=1 ttl=57 time=49.9 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=2 ttl=57 time=44.6 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=3 ttl=57 time=43.6 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=4 ttl=57 time=45.6 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 43.641/45.990/49.991/2.422 ms

$ ping -U google.com
PING google.com (216.58.199.174) 56(84) bytes of data.
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=1 ttl=57 time=54.9 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=3 ttl=57 time=46.0 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=4 ttl=57 time=42.8 ms
64 bytes from bom05s08-in-f14.1e100.net (216.58.199.174): icmp_req=5 ttl=57 time=42.2 ms
^C
--- google.com ping statistics ---
6 packets transmitted, 4 received, 33% packet loss, time 5013ms
rtt min/avg/max/mdev = 42.267/46.544/54.984/5.091 ms

谁能解释一下这两个命令有什么区别以及 ping 命令中 -U 选项有什么用途。

答案1

man ping

   -U     Print  full  user-to-user  latency (the old behaviour). Normally
          ping prints network round trip time, which can be different f.e.
          due to DNS failures.

相关内容