[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Four questions about examples of GNU Screen use

From: Lars Noodén
Subject: Four questions about examples of GNU Screen use
Date: Sat, 5 Mar 2016 20:23:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

I would greatly appreciate feedback on four examples of screen use that
I would like to provide in a guide.  I'm a novice user, albeit over many
years.  What, if anything, can be done better with the four examples
below?  Comments on any aspect welcome.


1) Here screen(1) is launched.

  ssh -l fred screen

Once a screen(1) session is running, it is possible to detach it and
close the SSH connection without disturbing the background processes it
may be running. Then the terminal session can be reattached in progress.

  ssh -l fred "screen -x"

2) Here ssh(1) is to assume that the connection is broken after 5
seconds of not being able to reach the server and to exit.

 while ! ssh -t address@hidden -o 'ServerAliveInterval 5' \
   screen -d -RR; do true; done

3) try attaching to an existing screen session or if none exist, make a
new screen session

 /usr/bin/screen -x || \
   /usr/bin/screen \
      sh -c "/usr/bin/cu -s 19200 -l /dev/ttyUSB0 | \
      /usr/bin/tee /home/fred/consultant.log"

4) If the same account is going to share a session, then it's an easy
procedure. In the one terminal, where sessionname is the name of your
screen session, start a new session:

  screen -S sessionname

In the other terminal, attach to that session:

  screen -x sessionname

If two different accounts are going to share the same session, then the
following steps are necessary. user 1 does this:

  screen -S sessionname
^A :multiuser on
^A :acladd user2

Then user 2 does this:

  screen -x user1/sessionname

reply via email to

[Prev in Thread] Current Thread [Next in Thread]