Bird
0
0

Given the following shell session:

medium📝 Command Output Q13 of 15
Linux CLI - Process Management
Given the following shell session:
$ sleep 100 &
[1] 12345
$ sleep 200 &
[2] 12346
$ jobs
[1]+  Running                 sleep 100 &
[2]-  Running                 sleep 200 &
What will be the output of jobs -l?
A[1]+ 12345 Stopped sleep 100 & [2]- 12346 Stopped sleep 200 &
B[1]+ Running sleep 100 & [2]- Running sleep 200 &
C[1]+ 12345 Running sleep 100 & [2]- 12346 Running sleep 200 &
DNo jobs to display
Step-by-Step Solution
Solution:
  1. Step 1: Understand jobs output

    The jobs command shows job number, status, and command. The -l option adds the process ID after the job number.
  2. Step 2: Match output format

    Since both jobs are running with PIDs 12345 and 12346, jobs -l will show job number, PID, status, and command.
  3. Final Answer:

    [1]+ 12345 Running sleep 100 & [2]- 12346 Running sleep 200 & -> Option C
  4. Quick Check:

    jobs -l adds PIDs to normal jobs output [OK]
Quick Trick: jobs -l shows PIDs next to job numbers [OK]
Common Mistakes:
  • Ignoring PIDs in output
  • Confusing Running with Stopped status
  • Expecting no jobs listed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes