0

Sometimes to get access to screen console I need to user screen -rx and not just screen -r.

Any idea why and why this happens ?

yarek
  • 827
  • 5
  • 13
  • 22

3 Answers3

3

-x attaches to an already running screen. Two or more terminals can share one session.

-r restores a detached session

Most probably you have to use -x when a session was not cleanly disconnected and is still considered running. The -xr is unnecessary in that case.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
2

screen -rx attaches to a session that is already attached elsewhere, and allows simultaneous use of the screen session by all attached parties.

In the event that a screen -r fails with something similar to:

There is a screen on:
    10250.ttys016.ironforge (Attached)
There is no screen to be resumed.

... you can use screen -rd to force the other party to detach & allow you to attach.

Phil
  • 156
  • 3
1

Use -x if you want to attach to an already running screen without detaching the other sessions.

If the session hasn't disconnected cleanly, you have other options than -x:

  • -d does the same than typing C-A d from the controlling terminal for the session.
  • -D is the equivalent to the power detach key. (Both -d &-D are ignored, when not applicable.)
  • Both of the above work in combination with -r resume and -R resume first appropriate.
  • A powerful & useful combination is -D -R for attach here and now.
  • For all combinations, see screen manual for command-line option -d.
Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129