I read the manual and online help, but still cannot grasp the idea of the screen command. Lets say I SSH to my linux shell. Inside it I want to run a program that will run for 8 hours:
- I create a "detached screen" by entering
screen
and thencrtl+a
,crtl+d
to deattach it. - Then I run my program
my_prog
What to do then? How do I return back to my normal terminal and continue my normal session started with? If I just close the SSH window and reconnect, then my program stops.
My question is that exact steps I must make to:
- Work in the shell as normal
- Run screen to run a program in the background
- Continue working in the old shell
- Exit the SSH session
- Establish a new SSH session and switch to my program that has worked while I was gone
Or is it the other way around? I enter my_prog &
, then call screen
and detach and then close the terminal window?