Using screen in linux

Screen is a very interesting utility that enables to persist a session when connecting from a terminal. To make a parallel, it’s the console version of vnc.

Start a new screen session:

screen -S <session_name>

Detach from the session but leave it running:

[Ctrl]-A D

End a session:

[Ctrl]-D

You can also start a session by starting a command line:

screen -dmS <session_name> <command_line>

In that case, the screen will be launched as a daemon and run in the background.

List all currently active sessions:

screen -ls

To attach to an existing session, use:

screen -x <session_name>

 

2 thoughts on “Using screen in linux

Leave a comment