title: Using bg and fg with a given PID
body: <p>I am using Ubuntu. </p>
  
  <p>If I am given a job’s PID, how can I bring the paused job to the background/foreground and running state?</p>
  
  <p>I know <code>bg/fg</code> but they require <code>job id</code> not <code>PID</code>.</p>
  
  <p>Also, I pause jobs with</p>
  
  <pre><code>kill -STOP &lt;PID&gt;
  </code></pre>
  
  <p>and I know that I can resume it with</p>
  
  <pre><code>kill -CONT &lt;PID&gt;
  </code></pre>
  
  <p>but I do not know how I can use bg and fg commands with this PID.</p>
  
  <p>Edit: I want to make this clear:</p>
  
  <p>Scenario: I have a paused job that I know its PID. How can I bring it back and make it work background?</p>