Linux Ping不显示日期

Linux Ping不显示日期,linux,shell,Linux,Shell,我正在将ping结果保存到文件中,但有时不显示日期。我尝试了一些ping,发现接收到0个数据包时不会显示日期,但并不总是这样。我在这里复制的第一个ping有0个接收到的数据包并显示日期,最后一个没有 [jsmith@localhost ~]$ ping 192.168.100.2 -D -c 1 -I eth0 PING 192.168.100.2 (192.168.100.2) from 192.168.100.3 eth0: 56(84) bytes of data. [1424572632

我正在将ping结果保存到文件中,但有时不显示日期。我尝试了一些ping,发现接收到0个数据包时不会显示日期,但并不总是这样。我在这里复制的第一个ping有0个接收到的数据包并显示日期,最后一个没有

[jsmith@localhost ~]$ ping 192.168.100.2 -D -c 1 -I eth0
PING 192.168.100.2 (192.168.100.2) from 192.168.100.3 eth0: 56(84) bytes of data.
[1424572632.214329] From 192.168.100.3 icmp_seq=1 Destination Host Unreachable

--- 192.168.100.2 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

[jsmith@localhost ~]$ ping 192.168.100.2 -D -c 1 -I eth0
PING 192.168.100.2 (192.168.100.2) from 192.168.100.3 eth0: 56(84) bytes of data.
[1424572638.603008] 64 bytes from 192.168.100.2: icmp_seq=1 ttl=64 time=0.374 ms

--- 192.168.100.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.374/0.374/0.374/0.000 ms

[jsmith@localhost ~]$ ping 192.168.100.2 -D -c 1 -I eth0
PING 192.168.100.2 (192.168.100.2) from 192.168.100.3 eth0: 56(84) bytes of data.
[1424572645.153724] 64 bytes from 192.168.100.2: icmp_seq=1 ttl=64 time=0.315 ms

--- 192.168.100.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.315/0.315/0.315/0.000 ms

[jsmith@localhost ~]$ ping 192.168.100.2 -D -c 1 -I eth0
PING 192.168.100.2 (192.168.100.2) from 192.168.100.3 eth0: 56(84) bytes of data.

--- 192.168.100.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

出了什么问题?

在第一次和最后一次执行中,您的答案有一个不同的解决方案:在第一种情况下,您确实收到了来自192.168.100.3的icmp数据包,告诉您192.168.100.2是不可恢复的;在后者中,没有收到数据包。