Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a script that save the ping logs to .txt or .log file. To monitor if my connection is intermittent or not, I'm using this script:

$nohup ping > timeout.txt &

Then when I check if its pinging:

$tailf timeout.txt

It's working! But when I stop the process by using:

$kill (process)

timeout.txt file is stop pinging but didn't show the statistic logs if I had any timeout or packet loss.

How to stop the ping and also showing the statistic?
Or do I have to add a script to my script?

share|improve this question
up vote 2 down vote accepted
kill -SIGQUIT `pgrep ping`

to show statistics and do not stop ping.

kill -SIGINT `pgrep ping`

to show statistics as usual (e.g., when you press ctrl-c in terminal) and stop ping.

share|improve this answer
Thanks for the Help 'int' :) – oacebes Apr 8 '13 at 8:01
Thanks that helped me – Sorcrer Aug 25 '14 at 11:39
For OS X it's SIGINFO. You can also press Ctrl-T if the process is in the foreground (or Ctrl-\ for SIGQUIT OSes). – Eric Boehs Jan 28 '15 at 5:28

Your Answer


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.