0

I have a screen session I run with a couple windows going on it that are running a couple applications that run a console in the terminal window (thus why I run them in screen).

I would like to be killing all the windows and then adding two new ones back that essentially just re-run the command to start the program up again.

Since this may be a little confusing here is what I would do if I was just trying to do this manually on the command line:

$ screen -x programs

$ (Hit Control-a + \ )

$ (Hit Control-a + c)

$ program1 args0 args1 #running first program again

$ (Hit Control-a + c)

$ program2 args0 args1 #running second program

Technically I don't even need to kill the existing windows, just stop the interactive window running. Normally I do this when in the window I just hit CTRL-D and the program stops running. Then I just run the program again.

I know there are commands so that I can attach to the existing screen session by name, I just have no idea how I could use that to send the equivalent of CTRL+D and then send another command to it.

0

try this to quit your screen session.

screen -dr your_session_name -X quit

Note:

Different Linux/Unix systems have different ways to handle long running processes. If your system controls processes using systemd, and the its version is above 230, try to read the latest manual of systemd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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