Bird
0
0

Why does the fg command require a job ID when multiple jobs are stopped, but not when only one job is stopped?

hard📝 Conceptual Q10 of 15
Linux CLI - Process Management
Why does the fg command require a job ID when multiple jobs are stopped, but not when only one job is stopped?
ABecause <code>fg</code> defaults to the most recent job if only one exists
BBecause <code>fg</code> cannot run without a job ID
CBecause the shell does not track jobs automatically
DBecause <code>fg</code> always requires a job ID regardless
Step-by-Step Solution
Solution:
  1. Step 1: Understand fg behavior with jobs

    If only one job is stopped, fg assumes it by default.
  2. Step 2: Multiple jobs require explicit job ID

    When multiple jobs exist, fg needs a job ID to know which to bring forward.
  3. Final Answer:

    Because fg defaults to the most recent job if only one exists -> Option A
  4. Quick Check:

    fg defaults to last job if only one stopped [OK]
Quick Trick: fg defaults to last job if only one stopped [OK]
Common Mistakes:
  • Thinking fg always needs job ID
  • Believing shell does not track jobs
  • Confusing fg with bg behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes