[Novalug] "screen" for simple/resumable/recoverable text windows

Doug Toppin dougtoppin at gmail.com
Mon Apr 16 17:27:11 EDT 2007


Depending on what I'm doing I sometimes find the 'screen' command to
be helpful for the situation.  'screen' (Screen version 4.00.02 (FAU)
5-Dec-03 for me) can be described as a simple full-screen window
manager (stealing from 'man screen' here) that multiplexes a physical
terminal between several processes.  I've found that I only had to
learn 7 different commands to make it useful enough for me so that I
can keep track of the commands on my fingers and not have to take my
socks off too.

It's probably easier to describe screen using a (far-fetched) situation:

* you're on a desert island with a recent Linux distribution but
   you can't run X so you have only the console in text mode (or it's
   the good old days and you have only a "dumb" terminal)
*  you have a wireless link to the outside world which goes up and down
    at unexpected intervals
* you need to ssh in to a remote system to do something that lets
   you afford to live on the desert island
* the something you need to do involves several text windows at
   the same time (edit sessions, log output, debug, ...)
* you could use virtual consoles and have each of them ssh'd to what
you're doing
   but every time the link goes down and then comes back up you have to log
   each of them back in again and resume what you were doing (and recover
   from hung/dead vim sessions, etc)

or, once the above finally drove you insane enough to try something different:

* you could do a single ssh in to the remote system and then run screen on
   that system and create multiple virtual text windows over that link
* in this case, if the link drops, you should be able to ssh back in and
   resume your screen server session with 'screen -r'

The commands you would need are (^ below means control):

screen      - start a screen server (note that 'screen -r' resumes one)
^a?          - get some help
^ac           - create a new window
^aw          - list the current windows (that you've started)
^a0          - go to window 0
^a1          - go to window 1 (and so on)
^az          - suspend the screen session (so that you can go home and
resume it)
^a<space> - go to the next window

Note that whenever you switch to a previously created window, it should
look exactly like when you left it (including pending edit sessions, ...).

Things like screen might not be immediately useful to you but it never hurts
to have them in your back pocket for a rainy day (or a slow link and/or bad
hardware).

If there's any interest and if there's time after the db session(s) at the next
NOVALUG meeting, I'll have a few slides/desktop movie to show the above
in excruciating detail (minus the desert island).

Doug


More information about the Novalug mailing list