d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Would Like Help (linux Shell - Putty) > Process To Finish Running & Exit Putty
Add Reply New Topic New Poll
Member
Posts: 10,365
Joined: Aug 5 2007
Gold: 0.00
Dec 19 2012 05:10pm
Could I get some help here? I'm running putty and I am not to keen on linux terminology just yet. I did some googling and came across the following

^Z
bg %1
disown -h %1

but I'm not quite sure how to implement this.
Is it simple hit Ctrl+Z to pause the process, then type 'bg %1' into putty, hit enter, then the same for 'disown -h %1'?

Also I would think I should put the process number or name somewhere. Where would that go if my hunch is correct?

e:\ the thing is I expect my program to take a few days to run and I don't want to leave my computer up the whole time. That's the program related.

This post was edited by ass666 on Dec 19 2012 05:18pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 19 2012 05:30pm
Quote
e:\ the thing is I expect my program to take a few days to run and I don't want to leave my computer up the whole time. That's the program related.


just run it under nohup then you can sign off putty
Member
Posts: 10,365
Joined: Aug 5 2007
Gold: 0.00
Dec 19 2012 05:44pm
I read about that and my understanding is that I can only do that if I have yet to start the program. Is that correct?

If so then I'd rather not do that since my program has already started running and is about 7 hours into running.
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Dec 19 2012 07:43pm
use screen

$ screen

should load up a new shell inside a screen session

while inside the screen session, run whatever command it is that you want

$ foo
Running foo, this is going to take 3 days....


From there, hit ctrl+a ctrl+d to get out of the screen back to your normal shell, and exit.

To return to the screen, in the normal shell, type:
$ screen -r



Google some how-tos and stuff if you want to learn more about using screen.

-----------

Oh, and yes, you can't move an existing shell session into a screen session. You will have to restart the job.

This post was edited by irimi on Dec 19 2012 07:44pm
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Dec 19 2012 09:52pm
Quote (irimi @ Dec 19 2012 09:43pm)
use screen

$ screen

should load up a new shell inside a screen session

while inside the screen session, run whatever command it is that you want

$ foo
Running foo, this is going to take 3 days....


From there, hit ctrl+a ctrl+d to get out of the screen back to your normal shell, and exit.

To return to the screen, in the normal shell, type:
$ screen -r



Google some how-tos and stuff if you want to learn more about using screen.

-----------

Oh, and yes, you can't move an existing shell session into a screen session.  You will have to restart the job.


this i dont do anything outside screen really. dont see why anyone would...
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Dec 19 2012 11:57pm
typo in the above - it's just ctrl+a and then d, not ctrl+d.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll