Question

I've started several sessions in screen. Now I want to get into one of them. I've read manual about screen and since that I could see screen sessions list via

screen -list

So, now I know what session I want to get into, because I know its creation time and the above command showed me a list of sessions with their creation times.

Can one tell me how can I get into specific screen session to see its output and to send it commands?

Was it helpful?

Solution

Reattach to the session:

screen -r <session_id>

Example:

  1. Create a session, give it a nice name:

    user:~$ screen -S nananananana_batman
    
  2. Close the terminal (detach).

  3. List the active sessions:

    user:~$ screen -list
    
    There is a screen on:
        3151.nananananana_batman    (10/23/2013 05:34:02 PM)    (Detached)
    1 Socket in /var/run/screen/S-user.
    
  4. Reattach back to our session:

    user:~$ screen -S nananananana_batman
    

OTHER TIPS

Try out screen -x, i use it often when there is only one screen session.

It can also be used to attach a session where you forgot to detach/lost connection etc.

screen -R will try to attach the youngest session.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top