Bird
0
0

After running sleep 100 &, you accidentally run fg %2 and get an error. What is the problem?

medium📝 Debug Q7 of 15
Linux CLI - Process Management
After running sleep 100 &, you accidentally run fg %2 and get an error. What is the problem?
AThere is no job with ID 2
BYou must use <code>bg</code> to resume jobs
CYou need to stop the job first with ctrl+z
DThe sleep command cannot be resumed
Step-by-Step Solution
Solution:
  1. Step 1: Understand job numbering

    Running one background job creates job 1, so job 2 does not exist.
  2. Step 2: Reason about error

    Trying to fg %2 causes error because job 2 is not present.
  3. Final Answer:

    There is no job with ID 2 -> Option A
  4. Quick Check:

    Only existing jobs can be fg'd [OK]
Quick Trick: Check jobs list to confirm job IDs before fg/bg [OK]
Common Mistakes:
  • Assuming multiple jobs exist without checking
  • Confusing fg and bg usage
  • Thinking sleep cannot be resumed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes