Some things won't respond to Ctrl+C; in that case, you can also do Ctrl+Z which stops the process and then kill %1 - or even fg to go back to it. Read the section in man bash entitled "JOB CONTROL" for more information. It's very helpful. (If you're not familiar with man or the man pager, you can search using /. man bash then inside it /JOB CONTROLEnter will start searching, n will find the next match which is the right section.)

Answer from Chris Morgan on Stack Overflow
🌐
Linux Kernel Labs
linux-kernel-labs.github.io β€Ί refs β€Ί heads β€Ί master β€Ί lectures β€Ί interrupts.html
Interrupts β€” The Linux Kernel documentation
Select and arrange the commands or output of the commands in the correct order. (void *) 0xc15de780 <entry_SYSENTER_32> set $idtr_addr=($idtr_entry>>48<<16)|($idtr_entry&0xffff) print (void*)$idtr_addr set $idtr = 0xff800000 (void *) 0xc15de874 <entry_INT80_32> set $idtr = 0xff801000 set $idtr_entry = *(uint64_t*)($idtr + 8 * 128) monitor info registers Β· In Linux the interrupt handling is done in three phases: critical, immediate and deferred.
🌐
O'Reilly
oreilly.com β€Ί library β€Ί view β€Ί understanding-the-linux β€Ί 0596005652 β€Ί ch04s06.html
4.6. Interrupt Handling - Understanding the Linux Kernel, 3rd Edition [Book]
November 17, 2005 - The _ _do_IRQ( ) function4.6.1.8. Reviving a lost interrupt4.6.1.9. Interrupt service routines4.6.1.10. Dynamic allocation of IRQ lines4.6.2.
Authors Β  Daniel P. BovetMarco Cesati
Published Β  2005
Pages Β  942
Top answer
1 of 2
2

The command stty -a will show you all keyboard shortcuts in your current terminal. Generally in Unix-like systems, the only signals mapped are Ctrl+C (SIGINT), Ctrl+\ (SIGQUIT), and Ctrl+Z (SIGTSTP). There are no other bindings to other signals, and therefore no other signals that you can send within your current session with the keyboard.

Generally speaking, the final d in a program's name usually indicates "daemon". Daemons are intended to run in background and operate through other means beyond stdin/out (like pipes, signals, sockets...). That means that it could be that you get unexpected behavior when the program itself is not running in background (like the terminal seems to "hang", because the daemon has done something to the input, output, or it's doing something/waiting in a loop)

Also generally, it could be as well that the daemon has traps for specific signals and handles them differently (or even ignores them). Have you tried to send SIGINT (kill -2, equivalent to Ctrl+C), SIGQUIT (kill -3, equivalent to Ctrl+\), or SIGTSTP (kill -20, equivalent to Ctrl+Z) while running mysqld in background, just for testing purposes?

EDIT: To change stty mappings, you'll need to write:

stty <action> <new-mapping>

For example, to remap SIGINT to Ctrl+X

stty intr ^x

Note that this setting is only valid in the current terminal during the current session.

2 of 2
0

Ctrl+Z is actually a feature of the generic terminal interface in the kernel, not of bash. It causes a SIGTSTP signal to be sent to the foreground process. Likewise Ctrl+C sends SIGTERM and Ctrl+\ sends SIGQUIT.

There are two ways in which a program can cause Ctrl+Z to lose its effect.

  • The program can ignore the SIGTSTP signal.
    You can check the a process's signal behavior with a debugger. On Linux, the information is available via /proc: grep Sig /proc/1234/status where 1234 is the process ID shows which signals are ignored (SigIgn, they'll just bounced off harmlessly) or blocked (SigBlk, they're put in wait until the program lets them in). The number is a bitmask and written out in hexadecimal. SIGTSTP is signal 20 (run kill -l in bash) so it is ignored if on the SigIgn line, the fifth digit from the right is 8 or above.
  • The program can change the key bindings.
    You can check the current key bindings with a command line like stty -a </dev/pts/42 where /dev/pts/42 is the terminal where the process is running. Look for susp = ^Z.

A daemon is likely to ignore most signals. Launch it in the background, if it doesn't fork by itself (most daemons actually fork a child as soon as they start and let the parent immediately). If you launched it in the foreground, there are many ways to recover (send it or its parent shell a signal) but you'll need another shell for that.

🌐
O'Reilly
oreilly.com β€Ί library β€Ί view β€Ί linux-device-drivers β€Ί 0596005903 β€Ί ch10.html
10. Interrupt Handling - Linux Device Drivers, 3rd Edition [Book]
February 7, 2005 - That way, of course, is interrupts. An interrupt is simply a signal that the hardware can send when it wants the processor’s attention. Linux handles interrupts in much the same way that it handles signals in user space. For the most part, a driver need only register a handler for its device’s interrupts, and handle them properly when they arrive.
Authors Β  Jonathan CorbetAlessandro Rubini…
Published Β  2005
Pages Β  636
🌐
Opensource.com
opensource.com β€Ί article β€Ί 20 β€Ί 10 β€Ί linux-kernel-interrupts
How the Linux kernel handles interrupts | Opensource.com
October 5, 2020 - You can find more information about this in the Linux Foundation's article Intro to real-time Linux for embedded developers. Exceptions are the type of interrupt that you probably know about. When the CPU executes a command that would result in division by zero or a page fault, any additional execution is interrupted.
Find elsewhere
🌐
Montana
cs.montana.edu β€Ί courses β€Ί spring2005 β€Ί 518 β€Ί Hypertextbook β€Ί jim β€Ί media β€Ί interrupts_on_linux.pdf pdf
Linux Interrupts: The Basic Concepts Mika J. JÀrvenpÀÀ University of Helsinki
Handler: smp call function interrupt(). ... I/O APIC(s). It is also possible to share IRQs (capable to Β· handle more I/O devices than there are IRQ lines) in Linux.
🌐
Medium
medium.com β€Ί @18bhavyasharma β€Ί command-working-behind-the-ctrl-c-and-ctrl-z-interrupt-signals-in-linux-c5d802f914f3
Command Working Behind the Ctrl+C and Ctrl+Z Interrupt Signals in Linux | by bhavya sharma | Medium
October 29, 2024 - They enable the kernel to communicate with running processes, and allow users to control these processes efficiently. Some common signals include: SIGINT (2): Interrupts a process (ctrl+c).
Top answer
1 of 2
15

As far as I know, the only signals that have a default keyboard shortcut in the shell are SIGINT (Ctrl + C) to stop a process and SIGTSTP (Ctrl + Z) to pause one.

Apparently, as Radu Rădeanu just taught me, there is also Ctrl+\ which is mapped to SIGQUIT.

You can find a list of all signals and what they do in man 7 signal:

   Signal     Value     Action   Comment
   ──────────────────────────────────────────────────────────────────────
   SIGHUP        1       Term    Hangup detected on controlling terminal
                                 or death of controlling process
   SIGINT        2       Term    Interrupt from keyboard
   SIGQUIT       3       Core    Quit from keyboard
   SIGILL        4       Core    Illegal Instruction
   SIGABRT       6       Core    Abort signal from abort(3)
   SIGFPE        8       Core    Floating point exception
   SIGKILL       9       Term    Kill signal
   SIGSEGV      11       Core    Invalid memory reference
   SIGPIPE      13       Term    Broken pipe: write to pipe with no
                                 readers
   SIGALRM      14       Term    Timer signal from alarm(2)

   SIGTERM      15       Term    Termination signal
   SIGUSR1   30,10,16    Term    User-defined signal 1
   SIGUSR2   31,12,17    Term    User-defined signal 2
   SIGCHLD   20,17,18    Ign     Child stopped or terminated
   SIGCONT   19,18,25    Cont    Continue if stopped
   SIGSTOP   17,19,23    Stop    Stop process
   SIGTSTP   18,20,24    Stop    Stop typed at terminal
   SIGTTIN   21,21,26    Stop    Terminal input for background process
   SIGTTOU   22,22,27    Stop    Terminal output for background process
   SIGBUS      10,7,10     Core    Bus error (bad memory access)
   SIGPOLL                 Term    Pollable event (Sys V).
                                   Synonym for SIGIO
   SIGPROF     27,27,29    Term    Profiling timer expired
   SIGSYS      12,31,12    Core    Bad argument to routine (SVr4)
   SIGTRAP        5        Core    Trace/breakpoint trap
   SIGURG      16,23,21    Ign     Urgent condition on socket (4.2BSD)
   SIGVTALRM   26,26,28    Term    Virtual alarm clock (4.2BSD)
   SIGXCPU     24,24,30    Core    CPU time limit exceeded (4.2BSD)
   SIGXFSZ     25,25,31    Core    File size limit exceeded (4.2BSD)

   SIGIOT         6        Core    IOT trap. A synonym for SIGABRT
   SIGEMT       7,-,7      Term
   SIGSTKFLT    -,16,-     Term    Stack fault on coprocessor (unused)
   SIGIO       23,29,22    Term    I/O now possible (4.2BSD)
   SIGCLD       -,-,18     Ign     A synonym for SIGCHLD
   SIGPWR      29,30,19    Term    Power failure (System V)
   SIGINFO      29,-,-             A synonym for SIGPWR
   SIGLOST      -,-,-      Term    File lock lost (unused)
   SIGWINCH    28,28,20    Ign     Window resize signal (4.3BSD, Sun)
   SIGUNUSED    -,31,-     Core    Synonymous with SIGSYS

You can see the signals that are available on your system with kill -l:

$ kill -l
 1) SIGHUP      2) SIGINT        3) SIGQUIT      4) SIGILL      5) SIGTRAP
 6) SIGABRT     7) SIGBUS        8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR
31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
63) SIGRTMAX-1  64) SIGRTMAX    

Note that there are many SIGRTMAX and SIGRTMIN signals, the Linux kernel supports 32 different signals but the range of signals actually supported will depend on the glibc implementation on your system.

2 of 2
7

The SIGQUIT signal is similar to SIGINT (produced by Ctrl+C), except that it's controlled by a different key β€” the QUIT character, usually Ctrl+\ β€” and produces a core dump when it terminates the process, just like a program error signal. You can think of this as a program error condition "detected" by the user.

So, Ctrl+\ (Ctrl + Backslash) may be what you want.

Reference: Termination Signals.

🌐
Baeldung
baeldung.com β€Ί home β€Ί processes β€Ί interrupt handling in linux
Interrupt Handling in Linux | Baeldung on Linux
March 19, 2025 - The Programmable Interrupt Controllers (PIC) are responsible for collecting the IRQ and determining the order for passing the interrupt signals to the processor. Each CPU has IRQ assigned, and the PIC listens to the IRQ. Recent Linux systems distribute the IRQ among the cores with the Advanced ...
🌐
Red Hat
docs.redhat.com β€Ί en β€Ί documentation β€Ί red_hat_enterprise_linux β€Ί 6 β€Ί html β€Ί performance_tuning_guide β€Ί s-cpu-irq
4.3. Interrupts and IRQ Tuning | Performance Tuning Guide | Red Hat Enterprise Linux | 6 | Red Hat Documentation
Setting this value to 1, as follows, means that only CPU 0 can service this interrupt: # echo 1 >/proc/irq/32/smp_affinity # cat /proc/irq/32/smp_affinity 1 Β· Commas can be used to delimit smp_affinity values for discrete 32-bit groups. This is required on systems with more than 32 cores. For example, the following example shows that IRQ 40 is serviced on all cores of a 64-core system:
🌐
Linux Kernel Labs
linux-kernel-labs.github.io β€Ί refs β€Ί heads β€Ί master β€Ί labs β€Ί interrupts.html
I/O access and Interrupts β€” The Linux Kernel documentation
Note that the registry value is a scancode, not the ASCII value of the character pressed. Also note that an interrupt is sent both when the key is pressed and when the key is released. We only need to select the code when the key is pressed and then and decode the ASCII character. ... To check scancode, we can use the showkey command (showkey -s).
🌐
The Geek Stuff
thegeekstuff.com β€Ί 2014 β€Ί 01 β€Ί linux-interrupts
Introduction to Linux Interrupts and CPU SMP Affinity
January 27, 2014 - I find useful β€œwatch” command to read these files (interrupts or stat). ... But in /proc i can’t see that number. # ls -l /proc/irq/16 ls: cannot access /proc/irq/16: No such file or directory Β· This is interesting… i am seeing following.. what are following numbes? /proc/irq/158/eno1-rx-2/ /proc/irq/159/eno1-rx-3/ /proc/irq/160/eno1-rx-4 ... My name is Ramesh Natarajan. I will be posting instruction guides, how-to, troubleshooting tips and tricks on Linux, database, hardware, security and web.
🌐
Geek University
geek-university.com β€Ί home β€Ί linux β€Ί irq (interrupt request)
IRQ (Interrupt Request) - Linux - Geek University
January 15, 2016 - In Linux, IRQ mappings are stored in the /proc/interrupts file: In the picture above, you can see the names of the drivers that are using each IRQ. For example, the floppy driver is using IRQ 6.
🌐
Alibaba Cloud Community
alibabacloud.com β€Ί blog β€Ί understanding-cpu-interrupts-in-linux_597128
Understanding CPU Interrupts in Linux - Alibaba Cloud Community
January 11, 2021 - You can run the echo command to change the CPU specified to handle interrupts. In the following example, interrupt 27 is allocated to CPU 0 for processing.