Pages

Tuesday, December 20, 2011

Detaching a shell with "screen"

If you want to protect yourself against connectivity lost with Unix / Linux, screen is the perfect command for you.

In a shell, type the command screen.

It will create a new shell.

Launch the command that you want and close your shell window.

We your are back, type screen -ls to show the list of active screen session.

You will get something like this:

[06:19:36]$ screen -ls
There are screens on:
    11944.pts-0.myserver    (Detached)
    4859.pts-3.myserver    (Detached)
    12190.pts-4.myserver    (Attached)
3 Sockets in /var/run/screen/S-user.


Attached => The shell window is still active.
Detached => No open shell window.



To join the screen session, type screen -r 11944.pts-0.myserver where the parameter is the session name.



To logout, simple type exit


No comments:

Post a Comment