$RodHat_/search

$ man 7 signal · diff

SIGINT vs SIGQUIT

What is the difference between Ctrl-C and Ctrl-\?

The terminal normally sends SIGINT for Ctrl-C and SIGQUIT for Ctrl-\. Their default actions differ: SIGINT terminates; SIGQUIT terminates and requests a core dump. Programs may install handlers and change what you observe.

FieldSIGINTSIGQUIT
Linux number23
FreeBSD number23
Default actionTerminate the processTerminate and dump core
Catch, block or ignoreYesYes

SIGINT

SIGINT is the ordinary interactive interruption. The terminal sends it to the foreground process group, so a pipeline can have more than one recipient.

SIGQUIT

SIGQUIT is the diagnostic escape hatch when you want a core under the default disposition. A runtime may handle it differently, so inspect that program before treating it as a guaranteed core-file command.

Rod's field note

Ctrl-C is the first thing to try for an interactive command. Use Ctrl-\ when a stuck program needs a useful failure artifact and you understand where its core dumps go. Neither key is a substitute for investigating why it wedged.

What to check

If the keystrokes do not behave as expected, check terminal settings, the foreground process group and the program’s installed signal dispositions.

Sources and scope

Default actions and Linux numbers follow signal(7). FreeBSD numbers follow the FreeBSD signal(3) manual. Numbers shown are Linux x86/arm64 and FreeBSD; other Linux architectures may differ. Installed handlers can change observed behavior except for signals that cannot be caught.

← More signal comparisons