The ``Screen'' Window Manager
Sometimes you're in a big hurry and you don't want to start X11 to get something done. Perhaps you're in an airport and want to be able to dash off to your plane on a moment's notice. Perhaps you're in a meeting, and X is not running, and you don't want to take the time to start it. Maybe you have to telnet into your box and you must work through a remote terminal. Or perhaps you're compiling a kernel or some other big applications, and you don't want to let X take up system resources. Whatever the reason, ``Screen'' will save your bacon in such circumstances. (Or especially if you're a Unix power user who simply likes the command prompt.)
Of course, you could always use the ALT-F1 thru ALT-F6 keys to switch between virtual terminals at the console, but Screen actually does quite a bit more and is easier to use once you get used to it. It's also faster. Screen is actually a ``screen multiplexer.'' Besides, six screens often aren't enough for the busy Unixophile.
Screen for Newbies. As with many Unix utilities, there is far more to Screen than you'll be able to use at first. But assuming you already have it installed, you can get started right away by simply typing: screen and hitting the return key.
You'll see a startup message, normally. And you'll be in your first virtual terminal with a shell prompt. (If no one has told you, the shell is probably the greatest Unix power tool there is!) Now if you want to read mail, type pine or mutt or whatever your favorite console-based mail reader is. If you want another application, such as Lynx or something, type CTL-a c and you don't even have to hit the return key. Now you can type ls or whatever strikes your fancy, and then hit CTL-a p and you're back in your mail reading session. Type CTL-a n and you're back at the shell prompt. If you type CTL-a w you'll see a listing at the bottom of the display with all the virtual terminals you have open and the applications that are running in them.
Just for fun. Just for an experiment, try running Screen in an xterm or in a console without X. (Yes, Screen runs fine in an Xterm or RXVT or any VT100 compatible terminal.) Right now, for example, I'm running an XTerm with a Screen manpage in one virtual Screen terminal, this Vim session in another virtual Screen terminal, Lynx on an HTML document in another virtual Screen terminal, and another couple of BASH terminals just for good measure. Oh, and I'm running this in X. (Screen is faster than paging desktops with your mouse using, say, Window Maker's desktop pager.)
You could try opening Elm or Pine or something, just as you would in an XTerm. Now that Elm is running, type CTL-a c emacs -nw and you'll see Emacs start in a new terminal. If you don't believe that you really have two applications running now, type CTL-a w. You'll see that each virtual terminal listed at the bottom of your screen has a number. You can switch to each terminal by typing CTL-a N where N is the number of the screen. Or you can just cycle through your sessions by typing CTL-a p or CTL-a n for the ``previous'' and ``next'' sessions respectively.
Getting fancy. Of course, you could spend most of your time just using a few applications that you could switch between with CTL-a n and CTL-a p, but there's really quite a bit more that you can do. For example, by using a .screenrc file in your home directory, you can add keybindings and greatly customize your screen sessions. Just like any X11 window manager, you can customize your console window manager also.
You could, for example, create names for virtual workspaces that start automatically when you start Screen. Your .screenrc file could specify the names of the workspaces and could start your essential applications in them as soon as you start screen.
You could change your ``magic key binding'' also. By default, Screen recognizes CTL-a and whatever letter you type next to look for commands. But you can customize that if you want.
Let's say you are reading news, and you want to check your time. If you're in X, of course you could check your Asclock, or whatever you're running. But if you're not running X, or if you're accessing an account through a telnet session and screen, then you could find the time by typing CTL-a t. Pretty simple, huh?
And if you want to leave your terminal for a moment, how do you lock it? CTL-a x will do it.
Of course, the most powerful and most useful combination of all is the help function: CTL-a ?. This you'll probably use all the time, since there are so many things Screen can do that you may not know about.
You can copy text from one terminal using CTL-a [ and paste it into another by typing CTL-a ]. And you can issue commandline commands to Screen by pressing CTL-a :.
Conclusion. If you've been using Unix/Linux for a
while, you're probably addicted to the speed of high quality
applications that run in the console. If you're already finding
yourself switching ferociously between XTerms in your X11 session, or
between ALT-F1 and ALT-F2 sessions at the console, check
out Screen. There is good documentation in the man page, and you'll
also find various pieces of documentation around the Web. One of the
better tutorials in Sven Gucke's page at
http://www.math.fu-berlin.de/~guckes/. Not only will you get
addicted to its speed and flexibility, but you'll be able to make your
flight at the airport; just shut Screen down by issuing the
CTL-a CTL-\ command.