Exercise 2: Protecting a Job Without Restarting It — Possible Solution ======================================================================== $ sleep 800 ^Z (press Ctrl-Z) [1]+ Stopped sleep 800 $ bg [1]+ sleep 800 & $ disown %1 $ jobs # prints nothing: job 1 is gone $ exit Log in again: `pgrep -a sleep` shows sleep 800 still running. The bg step matters: disowning a stopped job would leave it stopped forever, with no shell to resume it. disown vs. disown -h here: disown %1 Removes the job from bash's job table. The shell forgets it entirely, so it won't send it SIGHUP — but you also can't use fg, bg or %1 on it any more in this shell. disown -h %1 Leaves the job in the table (jobs still lists it, and fg still works) but marks it so the shell won't send it SIGHUP when the session ends. Use -h if you might still want to bring the job back to the foreground before logging out; plain disown if you're done with it. WHY THIS WORKS AS AN ANSWER ------------------------------ It uses the correct order (Ctrl-Z, bg, disown) and explains the practical difference between the two forms rather than only their definitions.