Put A Running Job In Nohup

15th September 2016 at 1:02am

Keywords: Linux

Abstract

Have you ever started a job from the command line and then realize the job should be in the background? Here's a process to disconnect an executing job from the terminal.

Process

Here are the steps. The disown step is the key. Explanation below.

ctrl-z
bg
disown -h [job-spec]
  1. pause the program and return to shell
  2. send program to background
  3. disconnect it upon terminal closure; job-spec is the job number from the first step

See this StackOverflow article for the full explanation.