swanwish / blog

My blog website
0 stars 0 forks source link

Change normal task to nohup #15

Open swanwish opened 7 years ago

swanwish commented 7 years ago

How do I put an already-running process under nohup?

Using the Job Control of bash to send the process into the background:

Ctrl+Z to stop (pause) the program and get back to the shell. bg to run it in the background. disown -h [job-spec] where [job-spec] is the job number (like %1 for the first running job; find about your number with the jobs command) so that the job isn't killed when the terminal closes.

swanwish commented 6 years ago

The disown command likes

disown -h %1