Take console productivity to a new level with Screen
Tuesday, November 30 2004 @ 08:03 PM EST Contributed by: glosser
"Screen is an application that's often underestimated. Screen is, simply put, a screen manager with VT100/ANSI terminal emulation. Think of it as a full screen, text-based window manager for your terminal or console. For what it is, it's an incredibly feature-rich application. In this article, I will explain what it does and why it's so useful."
"According to the man page, Screen "multiplexes aphysical terminal between several processes (typically interactive shells)." What this means to the rest of us is that you start up Screen and run something in it (typically with a shell), and do whatever you normally would in a terminal. This is all fine and dandy but in and of itself isn't anything new.
Perhaps the most popular feature of Screen is something called detaching. Let's start with an example. It's 4 p.m. and you need to start compiling an application that takes around three hours to compile. After it compiles, you need to reboot the system. All this needs to be done by tomorrow morning. Typically that would mean spending the evening at the office, but not with Screen. With Screen you can start it up, start compiling the application, and then detach from the screen session altogether. Detaching will take you back to the command line from which you originally ran screen. At that point you can actually log out of the system and go home for dinner.
Before you panic, let me remind you that you did not suspend the compile job or forfeit your rights to the processor. It's still compiling. You just don't have to keep that specific terminal open in order to keep tabs on it. After you've enjoyed a nice dinner at home, you open up your laptop and SSH (Secure Shell) into the system, re-attach your Screen session and see what happened with the compilation. You'll be at the same command prompt where you started the compilation, complete with a buffer of what happened. You then simply reboot the system remotely and you're ready for the meeting in the morning -- and it didn't take all evening."