Skip to main content
1 of 4
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129

Ctrl+C makes the terminal send SIGINT to the foreground process group. A process that receives SIGINT can do anything, it can even ignore the signal. A common reaction to SIGINT is to exit gracefully, i.e. after cleaning up etc.

Your ping is simply designed to print statistics upon SIGINT and then to exit.

Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129