Linux Screen Commands

Screen – keep the session window process running in back ground even when you close it. It can be listed, attached and detached on need basis.

# List all existing screen on the shh or connected box
$ screen -ls 

# connecting a screen / resume to a screen
$ screen -r <screen name>

exit and leave application open
$ Ctrl + a, d

# Creating a screen
$ screen -S <screen name>

# Killing or deleting existing screen (attached or detached)
screen -S <some_name> -X quit

I connected a linux box, started, app server , tested it and when closed my session, all processes in that session got killed automatically. QA reported that the app server has stopped working. I again connected started and moment i closed session same thing happened. Then my friend @rey told that one your session closes all process related to that session gets killed automatically, so he recommended  me to use “Screen” so that even when i exit all my process will continue. I can name the screen and can resume it later, use history and it has several other benefits.

one could log into a system remotely, start screen, work, detach from the screen session, then reattach to it at a later time, in a different location, over a different connection. This is a great way to make sure you don’t lose work if you are remotely logging in over an unreliable connection.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.