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.


Just type


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

| improve this answer | |
  • In putty session the compilation is executing. So how do in between i type the screen command? – Mukesh Apr 14 '17 at 5:20
  • You need to first type screen and then start your compilation – Sava Apr 14 '17 at 9: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

Not the answer you're looking for? Browse other questions tagged or ask your own question.