Bird
0
0

What happens if you run nohup sleep 30 & and then close the terminal immediately?

medium📝 Command Output Q5 of 15
Linux CLI - Process Management
What happens if you run nohup sleep 30 & and then close the terminal immediately?
AThe sleep command stops immediately
BThe sleep command continues running for 30 seconds
CThe sleep command pauses until terminal reopens
DThe sleep command restarts from the beginning
Step-by-Step Solution
Solution:
  1. Step 1: Understand nohup effect on process

    nohup allows the process to ignore hangup signals and continue running after terminal closes.

  2. Step 2: Behavior of sleep command

    The sleep 30 command will keep running for 30 seconds regardless of terminal closing.

  3. Final Answer:

    The sleep command continues running for 30 seconds -> Option B
  4. Quick Check:

    nohup keeps process alive after terminal close [OK]
Quick Trick: nohup keeps commands running after terminal closes [OK]
Common Mistakes:
  • Thinking sleep stops immediately
  • Assuming sleep pauses
  • Believing sleep restarts

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes