2

From this question I know you can resume a stopped process by doing

kill -CONT $PID

is there a kill option to resume a process but in the background (like bg but using a PID?)

1

Sending kill -CONT $PID will not change the foreground/background status of the process indicted by $PID.

Wikipedia says:

A stopped job can be resumed as a background job with the bg builtin, or as the foreground job with fg. In either case, the shell redirects I/O appropriately, and sends the SIGCONT signal to the process, which causes the operating system to resume its execution.

Thus, since the shell I/O redirection will not change when using kill -CONT $PID, the process will effectively remain in the background of the shell.

  • @three-diag Since I can't comment above: this answers the question you ask in the body, but not in the title. Are you actually asking about programmatically causing the process to go to the background using its PID? Please update title/question to reflect the intended question. – user2943160 May 1 '16 at 14:58

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.