views:

781

answers:

3

I am an Ubuntu Linux user. I am running jobs remotely and started a screen session. During this session I sourced a file containing a long list of command lines arguments to be executed. I was forced off of the connection and now the jobs are still running in this screen and I am unable to kill them.

Does anyone know how to kill all running and future commands this script will execute. Thank you in advance.

+1  A: 

Reattach the screen with

screen -D -r

then you can resume your session.

David Schmitt
Thank you. That worked. I have another question. Within the context of this solution, when I reattach to my screen session:Without holding Ctrl-C until all commands abort, is there a faster way to kill all future commands in one swoop?
Patrick Hogan
Screen's manual would have told you that C-a C-k destroys the current window, which should take the shell and all future commands with it.
David Schmitt
+1  A: 

Use ps to identify the pid of the shell process (bash, tcsh, etc), then kill that...

Stobor
+1  A: 

If you just want to kill everything there is no need to even reattach to screen.

Just list the offending process(es):

pstree -pla

then kill whatever needs killing. Note that if you kill a process higher up the process tree, its children will (usually) go away as well.

sleske