Intermediate
Linux & Shell Scripting
Q66 / 100
What is the purpose of "background jobs" and the "nohup" command together, e.g. "nohup long_script.sh &"?
Correct! Well done.
Incorrect.
The correct answer is A) Running a command with "&" backgrounds it, but it may still get a SIGHUP and terminate if the terminal closes; "nohup" prevents the process from receiving SIGHUP, letting it keep running after logout
A
Correct Answer
Running a command with "&" backgrounds it, but it may still get a SIGHUP and terminate if the terminal closes; "nohup" prevents the process from receiving SIGHUP, letting it keep running after logout
Explanation
Without "nohup", background processes started from an interactive shell can be terminated by SIGHUP when the terminal closes; "nohup" (or tools like "disown", "screen", or "tmux") helps processes survive session disconnection.
Progress
66/100