0

Why is the parole(just a media palyer) still listed in the "JOBS" command output even after killing maually and why is not listed in the "PS" command output ?

  1. Does this mean the process is still runnig in background(ps:when i issued kill command the media playe[parole] is closed))?
  2. If running why is it not listed in the "PS" command output ? If not running what is the meaning of the output for "JOBS" command.

List of commands entered

0

jobs will apear one last time after any command once terminated.

see below

 > sleep 30 &
[1] 134042
 > ps
    PID TTY          TIME CMD
 134009 pts/4    00:00:00 bash
 134042 pts/4    00:00:00 sleep
 134043 pts/4    00:00:00 ps
 > kill 134042
 > date
Mon Aug  3 22:11:58 CEST 2020
[1]+  Terminated              sleep 30
 > jobs
 > 

according to man bash, JOB CONTROL

The shell learns immediately whenever a job changes state. Normally, bash waits until it is about to print a prompt before reporting changes in a job's status so as to not interrupt any other output.

so you can even use an empty command (i.e. press return), to see the done line.

| improve this answer | |
  • Thank you that cleared many of my doubts :) – Rakesh Nara 10 Aug 3 at 20:49
  • 1
    Also, a job that is stopped cannot receive a signal (the default is sigterm, and it may have a handler installed). So after you kill it, it needs to run just to terminate and have the shell notice, to get its status from the process list. A process is like Schrodinger's cat -- it is not truly dead until it is observed to be dead. – Paul_Pedant Aug 4 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.