If some-boring-process is running in your current bash session:

halt it with ctrl-z to give you the bash prompt

put it in the background with bg

note the job number, or use the jobs command

detach the process from this bash session with disown -h %1 (substitute the actual job number there).

That doesn’t do anything to redirect the output — you have to think of that when you launch your boring process. [Edit] There seems to be a way to redirect it https://gist.github.com/782263

But seriously, look into screen. I have shells on a remote server that have been running for months.

via

bash – How can I close a terminal without killing its children (without running `screen` first)? – Unix and Linux.

Annunci