>_ IzzyLab

Topic breakdown

An ampersand & sends a command to the background, but when you exit the shell its background children receive the SIGHUP signal and die. To make a process survive the session closing, it is launched under nohup, which ignores this signal, and its output is usually redirected to a file or /dev/null. The shell places the PID of the last process launched in the background into the $! variable — that's what you save. You can check that the process is alive with the "null" signal kill -0.

What's checked

  1. background sleep 300 under nohup is alive, PID saved

What it looks like