Moving a running process to background on Linux

A common problem for server administrators is starting a command that takes hours to complete shortly before leaving the office and heading home.

Here are a few commands that will help you leave your computer while allowing the running command to finish:

 

1. To stop the currently running command, press Ctrl+Z.

2. To move the stopped process to the background, execute the command: bg

3. To ensure the command continues running after you close the SSH session, execute the command: disown -h

4. Exit the SSH session and go home; the process will finish in the background

×