Sunday, March 06, 2011

Using Screen on Linux - Quick Start

I'm performing a long-running import (multiple days) and need to be able to check in on it every so often. Normally, disconnecting your SSH session will kill all of its processes, but screen sits a layer above that, creating a session that you may attach to and detach from at any time, from any SSH/terminal session. Screen is intimidatingly powerful—but here is the minimal info you need to be able to start a screen session and come back to it later.

screen -S <name>   Starts a named session. Once inside the session, start the import/whatever you will want to come back to.

^a d (CTRL+a d)    Detaches the current Screen session.

screen -list    List all sessions

screen -r <name>    Resume a detached session

Hope that helps!

No comments: