So in UNIX every job in a job control centre have a jobID and a PID. What is the difference between the two?

I'm also confused at what the point of a jobID is. If you have two of the same type of job (like two instances of the same program) running at once, will they both have the same jobID?

  • 1
    Which job control package are you talking about? Usually a jobID will be an indicator of a script or a set of commands, so no it won't be the same as a PID, which is unique to each UNIX process. – Scott Presnell Feb 15 '17 at 18:04
  • I'm not sure what package I use on my system! I'm still new to UNIX. So each process has a unique PID - got it. Does each job have a unique jobID even if they do the same thing? – Uq'''12wn1F12u2x3uW31H1JBk9m Feb 15 '17 at 18:14
  • Almost certainly the JobID will be unique to each invocation of the job - many times I submit the same job (same script), but what the job does is different depending on the contents of certain directories - I would want the JobID to be different in this case. (the one caveat to this is that JobID and PIDs will "roll over" after they reach the maximum of their underlying type, so after 32768, the next PID will be 1, or some small number that's not being used as a PID). – Scott Presnell Feb 15 '17 at 18:18
  • 1
    @ScottPresnell There are Unices (OpenBSD) where the PIDs are allocated in a random fashion. This is a security enhancement. – Kusalananda Feb 15 '17 at 18:27
  • That makes sense! So if I wanted to reach any certain job could I refer to it using either PID or jobID, no difference? – Uq'''12wn1F12u2x3uW31H1JBk9m Feb 15 '17 at 18:31

The point of a unique JobID is to be able to control a Job - pause it or, possibly delete it by job management tools. There may also be an accounting system that tracks the user, run time, cpu usage on a per-job basis - a unqiue JobID would aid in that bookeeping.

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.