]> sipb.mit.edu Git - wiki.git/blob - doc/UsingScreen
(no commit message)
[wiki.git] / doc / UsingScreen
1 = Using Screen =
2
3 == Why? ==
4
5 {{{screen}}} is a handy tool.  It lets you get more out of a terminal session, whether in a window, via ssh, or by some more esoteric means.
6 It's original reason for existence was allowing you to switch between subsessions on a [http://en.wikipedia.org/wiki/Video_terminal video-display terminal],
7 but grew to allow sessions that could be detached and reattached (if you went home for the day, or say you were connecting via a glitchy network) and eventually
8 to allow the same session to be simultaneously accessed from multiple places.
9
10 == Getting Started ==
11
12  1.  Pick a machine to run your screen session on.  If you don't know of any options, linux.mit.edu (Linerva) is a good choice.
13  2.  ssh to that machine.
14  3.  run {{{screen}}}
15  4.  Do stuff.
16
17 To detach, type "C-a d".  To reattach, type {{{screen -dr}}}
18
19 If you close your ssh connection without detaching, or lose your network connection.
20
21  1.  run {{{screen -dr}}}
22  2.  Do stuff.
23
24 The {{{-dr}}} means "find my screen session, detach it from wherever it's attached if it's attached, and reattach it here."
25
26 Once you're comfortable with this, hit "C-a C-c".  This creates what screen calls a new "window"; it should give you a new shell prompt,
27 and you can do stuff at it.  If you want to switch back to the old "window", hit "C-a C-a".   You can create as many "windows" as you want;  you can
28 switch to the first 10 of them with "C-a 0" through "C-a 9" and see a list of what's open with "C-a w".
29
30 A useful shorthand: {{{screen -dR}}} is like {{{screen -dr}}} except it adds a "if I don't already have a session, create one" step.
31
32 You can uses {{{screen -x}}} to attach a screen session