Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q4 of 15
Linux CLI - Process Management
What will be the output of the following commands?
sleep 3 &
echo "Done"
ADone (immediately), then sleep runs in background
BDone after 3 seconds, then sleep runs
Csleep runs first, then Done prints after 3 seconds
DNo output until sleep finishes
Step-by-Step Solution
Solution:
  1. Step 1: Understand background execution

    The sleep 3 & runs sleep in background, so shell immediately runs next command.
  2. Step 2: Analyze output order

    The echo "Done" runs immediately and prints "Done" before sleep finishes.
  3. Final Answer:

    Done (immediately), then sleep runs in background -> Option A
  4. Quick Check:

    Background & runs immediately, next command prints [OK]
Quick Trick: Background commands don't block next commands [OK]
Common Mistakes:
  • Assuming sleep blocks echo
  • Thinking output delayed
  • Confusing & with &&

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes