8

I am compiling some code on my Linux machine. And I was using putty to access the Linux machine on my windows laptop.

So now in between I need to close my "windows machine". So, putty session will also close. But I want to continue my compilation.

Mukesh
  • 93

1 Answers1

11

Just type

screen

And you will be inside the 'screen window' Then you can execute your command. If you close putty now, your command will keep running. Next time you log in to the Linux machine, you can execute

screen -r

And continue where you left off.

You can also manually detach the screen session by hitting ctrl+a followed by d

Sava
  • 176
  • 1
  • 7
  • In putty session the compilation is executing. So how do in between i type the screen command? – Mukesh Apr 14 '17 at 05:20
  • You need to first type screen and then start your compilation – Sava Apr 14 '17 at 09:06
  • 1
    Even easier to remember: Always use "screen -R". If possible, it will reattach the previous session, else it will start a new one. – gebbissimo May 28 '19 at 15:17