Linux 带绝对时间戳的ping
是否可以将每个ping数据包的系统时间放在ping之前 例如,当我每秒ping 1000次时,我们会看到如下情况:Linux 带绝对时间戳的ping,linux,ping,Linux,Ping,是否可以将每个ping数据包的系统时间放在ping之前 例如,当我每秒ping 1000次时,我们会看到如下情况: # ping 9.0.0.150 -i 0.001 PING 9.0.0.150 (9.0.0.150) 56(84) bytes of data. 64 bytes from 9.0.0.150: icmp_req=1 ttl=64 time=0.531 ms 64 bytes from 9.0.0.150: icmp_req=2 ttl=64 time=0.473 ms 64
# ping 9.0.0.150 -i 0.001
PING 9.0.0.150 (9.0.0.150) 56(84) bytes of data.
64 bytes from 9.0.0.150: icmp_req=1 ttl=64 time=0.531 ms
64 bytes from 9.0.0.150: icmp_req=2 ttl=64 time=0.473 ms
64 bytes from 9.0.0.150: icmp_req=3 ttl=64 time=0.472 ms
64 bytes from 9.0.0.150: icmp_req=4 ttl=64 time=0.497 ms
# ping 9.0.0.150 -i 0.001
PING 9.0.0.150 (9.0.0.150) 56(84) bytes of data.
12345123.122122 64 bytes from 9.0.0.150: icmp_req=1 ttl=64 time=0.531 ms
12345123.123122 64 bytes from 9.0.0.150: icmp_req=2 ttl=64 time=0.473 ms
12345123.124122 64 bytes from 9.0.0.150: icmp_req=3 ttl=64 time=0.472 ms
12345123.125122 64 bytes from 9.0.0.150: icmp_req=4 ttl=64 time=0.497 ms
我想要的是这样的东西:
# ping 9.0.0.150 -i 0.001
PING 9.0.0.150 (9.0.0.150) 56(84) bytes of data.
64 bytes from 9.0.0.150: icmp_req=1 ttl=64 time=0.531 ms
64 bytes from 9.0.0.150: icmp_req=2 ttl=64 time=0.473 ms
64 bytes from 9.0.0.150: icmp_req=3 ttl=64 time=0.472 ms
64 bytes from 9.0.0.150: icmp_req=4 ttl=64 time=0.497 ms
# ping 9.0.0.150 -i 0.001
PING 9.0.0.150 (9.0.0.150) 56(84) bytes of data.
12345123.122122 64 bytes from 9.0.0.150: icmp_req=1 ttl=64 time=0.531 ms
12345123.123122 64 bytes from 9.0.0.150: icmp_req=2 ttl=64 time=0.473 ms
12345123.124122 64 bytes from 9.0.0.150: icmp_req=3 ttl=64 time=0.472 ms
12345123.125122 64 bytes from 9.0.0.150: icmp_req=4 ttl=64 time=0.497 ms
前缀中的数字是系统时间。可能是这样的吗
ping 9.0.0.150 -i 0.001 | while read line
do
echo $(cut -f1 -d' ' /proc/uptime) $line
done