Is there a single command for screen
to completely close/quit all running programs in detached mode?
I hope to do this in a bash script without any further input.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityIs there a single command for screen
to completely close/quit all running programs in detached mode?
I hope to do this in a bash script without any further input.
You can use screen -X
to send a command to a running screen, so screen -X quit
should ask the session to terminate and kill all of its windows.
If you have multiple screens running, use -S
to identify them.
bash
script rather than terminal input. I edited the question.
– Googlebot
May 2 '17 at 23:54
screen -X quit -S $sessionname
will still ask a running screen session to quit, regardless of if the command is given from an interactive shell, or a script. Do you mean you have multiple screen sessions running, and want to close them all?
– ilkkachu
May 3 '17 at 9:53