There are Linux programs, for example vlc, that recommend typing ctrl+c twice to kill their execution from a terminal if the program didn't stop after the first one.

Why would typing ctrl+c twice work when the first time didn't work?


2 Answers 2


What it does is entirely application specific. When you press ctrl+c, the terminal emulator sends a SIGINT signal to the foreground application, which triggers the appropriate "signal handler". The default signal handler for SIGINT terminates the application. But any program can install its own signal handler for SIGINT (including a signal handler that does not stop the execution at all).

Apparently, vlc installs a signal handler that attempts to do some cleanup / graceful termination upon the first time it is invoked, and falls back to the default behavior of instantly terminating execution when it is invoked for a second time.

  • 3
    On some systems, the signal gets reverted to SIG_DFL after a call to the handler (to avoid calling the handler twice on the same signal); this is called SysV semantics. Many programs do not set the signal handler back to the original on-program settings at the end of the handler. This would normally be a programming bug. Read more information on the signal(2) manpage.
    – Arcege
    Commented Aug 21, 2011 at 18:24

SIGINT, the signal sent by Ctrl+C, conventionally tells a program to break out to its main command processing loop, or if that doesn't make sense, to exit cleanly. Some programs run a cleanup procedure when they receive a SIGINT. If the program is so messed up that the cleanup procedure fails, in some programs, a second Ctrl+C causes the program to quit immediately. Doing this is up to each program author.

If a second Ctrl+C doesn't kill the program, try Ctrl+\, which sends SIGQUIT, a more violent (but still catchable signal), or try Ctrl+Z to suspend the program and then the kill command (e.g. kill %1 which sends SIGTERM, a conventionally less violent signal than SIGQUIT, to job number 1). If all else fails, kill the program with kill -KILL, also known as kill -9, sending the uncatchable signal SIGKILL.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .