Bird
0
0

You run nohup my_script.sh & but the process stops after you logout. What is the most likely reason?

medium📝 Debug Q14 of 15
Linux CLI - Process Management
You run nohup my_script.sh & but the process stops after you logout. What is the most likely reason?
AYou did not redirect output, causing terminal hangup
BYou forgot to add & to run in background
CYou ran the command without nohup
DYou closed the terminal before the command started
Step-by-Step Solution
Solution:
  1. Step 1: Understand nohup and output redirection

    Without redirecting output, nohup writes to nohup.out, but if permissions or disk issues prevent this, the process may stop on logout.
  2. Step 2: Analyze options

    You did not redirect output, causing terminal hangup correctly points to output redirection issues causing hangup. You forgot to add & to run in background is wrong because & was added. You ran the command without nohup is wrong because nohup was used. You closed the terminal before the command started is unlikely as process starts immediately.
  3. Final Answer:

    You did not redirect output, causing terminal hangup -> Option A
  4. Quick Check:

    Output redirection needed to avoid hangup [OK]
Quick Trick: Always redirect output to avoid hangup with nohup [OK]
Common Mistakes:
  • Ignoring output redirection importance
  • Assuming & alone keeps process alive
  • Thinking nohup always works without output file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes