Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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
share|improve this answer
1  
One slight addition: You can emit SIGQUIT from the terminal by hitting "Ctrl-\", no need to have a second terminal open and use kill. –  Andreas Wiese Jul 11 at 13:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.