B-TIER resource
Ctrl+C vs kill -9 — why SIGINT can be ignored and SIGKILL can't
100k ft — What is this?
Ctrl+C vs kill -9 — why SIGINT can be ignored and SIGKILL can't
50k ft — Why care?
Ctrl+C sends SIGINT (signal 2) to the whole foreground process group, and programs like vim can catch or ignore it with a signal handler. For a guaranteed stop you escalate to SIGKILL (signal 9) with kill -9 <PID>, which no process can catch, block or ignore.
10k ft — Key takeaways
• Ctrl+C reaches the whole foreground process group, not one PID
• Scripts can trap SIGINT, so it is a request rather than a kill
• Use kill -9 only as a last resort; it skips cleanup
5k ft — Tools & techniques
(no tools tagged)
signal handling
1k ft — Deep-dive / try it
Interesting fact:
When you press Ctrl+C in a terminal, your shell sends a SIGINT (Signal Interrupt, signal #2) to the foreground process group — not just the process itself. The process can actually catch or ignore SIGINT using signal handlers, which is why some programs like vim or custom scripts don't immediately die when you press it. For a guaranteed kill, you'd escalate to SIGKILL (signal #9) via kill -9 <PID>, which cannot be caught, blocked, or ignored by any process.
Have you ever had Ctrl+C fail on you mid-script — and did you know why?
Transcript excerpt
. . . .