Categories
How-To Personal

Attach and Reattach to screen session

While using ssh to connect to my home systems to mange my servers (such as Minecraft) I use screen to keep my session(s) open so that if I get disconnected or simply forget and close my putty session I can later resume.  I sometimes find myself in the situation where I go home and later want to attache to my session to only find that I am already attached and this is where I again use screen to join the session that is already in progress.

Here are some sample commands I use normally while during my daily activities.

Attach the running session of screen
screen -r

Attach a specific screen session, you need to use screen -ls to list the running screen’s sessions.
screen -r [name]

and if you are attaching again (reattaching to a session in progress)
screen -d -r