The Joy of Screen

No Gravatar

One of the developers at work has introduced me to something quite fantastic on the Unix command line – screen.

Screen is, according to the GNU web site:

[Screen is] a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

It has really cool features, so let me line some up for you.

Multiple Window Support
I have often found the need to have more than one terminal open on the same machine for one reason or another. Do this on two or three machines at once, and chaos soon ensues on the desktop!

Screen allows you to effectively split the terminal in as many ways as you like, all in the one terminal session.

Session Persistence
The only kind of persistence I have been used to in the past was use history and recursive history search commands CTRL+r – providing that you are not sharing an account with any other user – then things can really go out of the window.

Yet again, screen is a revelation here – screen allows you to detach and hence reattach to the same session as before. In fact you can kill a terminal window whilst still attached to a session on one machine and then reattach to that same session from a completely different machine.

Sharing of Sessions
Screen allows multiple users to connect to the same session from different machines, with configurable access control lists and lots more. This is a feature I have not yet had a look at.

Above is a screenshot of a terminal running a split screen session.

Getting Started

To get a named screen session named test123 running on the command line, type:

 $ screen -S test123

This will then drop into the screen session directly. To detach from the screen session you just started, type CTRL+a and then d. To see a list of current screen sessions, do the following:

 $ screen -list
 There are screens on:
       	 	 19718.test123 	(Detached)
 1 Socket in /var/run/screen/S-redcow.

To reconnect with the session test from any terminal, type:

 $ screen -raAd test123

I won’t go through screen’s command set – there are plenty of resources on the web to point you to.

Once you have spent an hour or two using screen, you may just find it difficult to go back to a normal terminal!

Resources

  • Share/Bookmark

No Comments on “The Joy of Screen”

You can track this conversation through its atom feed.

No one has commented on this entry yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>