LINUX – Screen command

Screen  is  a  full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).

It is not installed by default but it can be easilly installed with yum or apt by calling up a package called “screen”

To start working just type in:


to list started sessions:

[root]# screen -list
There is a screen on: (Attached)
1 Socket in /var/run/screen/S-root.

to de-attach from running session:

[root]# screen -d 8210

[remote detached from]
[root]# screen -list
There is a screen on:    (Detached)
1 Socket in /var/run/screen/S-root.

to re-attach to our disconnected session just run:

[root]# screen -r 8210

Alternatively instead of using the IDs we can open new screen and name is:

[root]# screen -S mysession
[root]# screen -list
There are screens on:
        8283.mysession  (Attached)

and now we can re-attach to that session by calling its name:

[root]# screen -r mysession

Cool thing about screen that it very easy to setup a terminal sharing session so when i.e. two users log in as the same user they both will be able to see exactly the same thing.

to attach 2nd user to screen session called “mysession” issue this command:

[root]# screen -x mysession

The x option used above can only be used to connect to already attached session.



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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s