Take the 2-minute tour ×

If I'm logged into a remote Linux machine, I know I can suspend a process (cntr-z) and move it to the background (bg 1) but if I disconnect from the machine, the process stops.

Is there a way I can leave it in the background and have it there when I log back in? This is a very long running process.

On Ubuntu, logged in via SSH.

share|improve this question

2 Answers 2

Less flexible than screen are nohup and disown.

nohup is a program, and you have to start the long running jub with it like this:

$ nohup longjob --options-for-longjob

it will cause your long job to run in the background and not attached to any terminal (which means that you won't get any output from it on the screen and won't be able to direct input to it from the keyboard)

disown is a bash builtin that can disconnect a long running job after you've started it. My bash man page says


share|improve this answer

This is because your program need terminal to run, you can use GNU Screen to create a virtual terminal so that the program will continue to run even after you disconnect.
just run screen your_program_name, you can close screen with crtl-a-d then reopen it later with screen -rx

share|improve this answer
Wish I could accept your answer but I posted w/o logging in and now can't actually claim the question. =x But thank you, works perfectly. –  Erik Jun 27 '10 at 16:39

Your Answer


