Bird
0
0

You want to stop a running background job and bring it to the foreground. Which sequence is correct?

hard📝 Application Q9 of 15
Linux CLI - Process Management
You want to stop a running background job and bring it to the foreground. Which sequence is correct?
AUse <code>kill -STOP %jobnumber</code> then <code>fg %jobnumber</code>
BUse <code>bg %jobnumber</code> then <code>fg %jobnumber</code>
CUse <code>fg %jobnumber</code> directly
DUse <code>kill %jobnumber</code> then <code>fg %jobnumber</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand job control commands

    To stop (suspend) a running background job and bring it to the foreground, use kill -STOP %jobnumber first, then fg %jobnumber.
  2. Step 2: Analyze other commands

    fg alone brings it running to foreground; bg resumes stopped jobs in background; plain kill terminates.
  3. Final Answer:

    Use kill -STOP %jobnumber then fg %jobnumber -> Option A
  4. Quick Check:

    Bring stopped job foreground = kill -STOP then fg [OK]
Quick Trick: kill -STOP %jobnumber then fg %jobnumber to stop and foreground [OK]
Common Mistakes:
  • Using fg without stopping first
  • Confusing bg with fg
  • Using kill to terminate

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes