Linux – Check ping statistics without stopping

command linegnulinuxping

Is there a way to tell ping to show its usual termination statistics without stopping the execution?

For instance, I'd like to quickly view:

--- 8.8.8.8 ping statistics ---
2410 packets transmitted, 2274 received, +27 errors, 5% packet loss, time 2412839ms
rtt min/avg/max/mdev = 26.103/48.917/639.493/52.093 ms, pipe 3

without having to stop the program, thus losing the accumulated data.

Best Answer

From the ping manpage (emphasis mine):

When the specified number of packets have been sent (and received) or if the program is terminated with a SIGINT, a brief summary is displayed. Shorter current statistics can be obtained without termination of process with signal SIGQUIT.

So this will work if you're fine with your stats being slightly less verbose:

# the second part is only for showing you the PID
ping 8.8.8.8 & jobs ; fg

<... in another terminal ...>

kill -SIGQUIT $PID

Short statistics look like this:

19/19 packets, 0% loss, min/avg/ewma/max = 0.068/0.073/0.074/0.088 ms
Related Question