# Demonstration: Watching a Process Actually Terminate ## OBSERVE Start a long-running background process and note its PID: ``` $ sleep 300 & [1] 1421 ``` `1421` is the PID (yours will differ every time). ## HYPOTHESIS Predict: will `kill -0 1421` print anything if the process is still running? ## INSPECT ``` $ kill -0 1421 && echo "still running" still running ``` `kill -0` sends no real signal — silence (or, here, our own `echo`) means the process exists. ## CHANGE Now actually terminate it: ``` $ kill 1421 ``` ## VERIFY ``` $ kill -0 1421 2>/dev/null && echo "still running" || echo "gone" gone ``` The exact same check now reports the opposite result — real, observable proof the process is gone, not an assumption. ## Instructor Notes **Demo goal:** Make "checking before and after" a visible habit, not just narrated — students should see the SAME command return a different real answer once state actually changed. **Approximate timing:** 8 minutes live. **Common mistake to watch for:** reaching for `kill -9` by default "to be safe" — reinforce that plain `kill` (SIGTERM) is the correct first attempt almost always.