Phase 0: Command Line & OS Literacy · ~35 minutes · Terminal · job control · signals
Job Control, Signals, and Making the Terminal Yours
Ctrl-C doesn't force-quit anything. It sends a polite request (SIGINT) that a program can choose to ignore — which is exactly why it sometimes doesn't work.
Real-world application: Knows Ctrl-C is a request a program can ignore, not a guarantee, and reaches for SIGKILL correctly when it's genuinely needed
What you will learn
- Use & / fg / bg to move a process between foreground and background
- Explain Ctrl-C as sending SIGINT — a request a program can catch and ignore, not a forced stop
- Diagnose a stuck process ignoring Ctrl-C and correctly reach for SIGKILL
- Describe what dotfiles are and why personal terminal configuration lives there
Introduction
- Type: Learn
- Languages: Bash / Zsh
- Prerequisites: Permissions, Processes, and Environment Variables, Environment Variables and Config, for Real
- Time: ~35 minutes
Objective
Learning objectives
- Use
&/fg/bg to move a process between foreground and background - Explain Ctrl-C as sending
SIGINT — a request a program can catch and ignore, not a forced stop - Diagnose a stuck process ignoring Ctrl-C and correctly reach for
SIGKILL - Describe what dotfiles are and why personal terminal configuration lives there
What you're building
A script long_task.sh that prints a message every second for 60 seconds (a simple loop with sleep 1):
- Start it, background it with
&, confirm it's running with jobs - Bring it to the foreground with
fg, then interrupt it with Ctrl-C, and confirm in writing what signal that sends - Write a second script that traps and ignores
SIGINT (following this lesson's stubborn_script.sh pattern), start it, attempt to interrupt it with SIGINT (confirm it survives), then correctly stop it with SIGKILL - Record what you observed at each step in
job_control_notes.txt, including the exit status after each termination method
A long-running data import script won't stop after several Ctrl-C presses. What's the most accurate explanation and correct next step, based on this lesson?
This is precisely this lesson's reproduced example. Repeated Ctrl-C presses just mean SIGINT was sent repeatedly and not honored each time — a script can genuinely be written (or stuck in a state) that doesn't respond to it. SIGKILL is the deliberate, correct escalation specifically because it's the one signal the operating system enforces unconditionally, delivered outside the program's own ability to catch or ignore it — not a more forceful version of asking nicely, a fundamentally different mechanism.
This lesson is free
You've read the first 2 sections. The rest covers The Problem, Check Yourself, Key Terms & Next. A free account opens all of it, with its practice questions and its lab. No card.
Create a free account — the opening phases of 29 of 35 courses, and the first lesson of every phase, are free, no credit card.
Browse all courses · View pricing · DeVenture Academy