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:
End a session:
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:
To attach to an existing session, use:
screen -x <session_name>