Exercise 2: -r, -x and -d -r Against an Attached Session — Possible Solution ============================================================================= Setup: terminal A runs `screen -S demo` and stays attached. 1. In terminal B: screen -r demo Screen refuses. It reports that there is a screen on "12345.demo (Attached)" and that there is no screen to be resumed. Terminal A is unaffected. -r only resumes DETACHED sessions. 2. In terminal B: screen -x demo Terminal B attaches as well. Both terminals now show the same window: type in either one and the text appears in both. Terminal A is unaffected apart from seeing B's typing. Detach B with Ctrl-a d when done. 3. In terminal B: screen -d -r demo Screen detaches the session from terminal A (A returns to its normal shell with a "[remote detached ...]"-style message), then attaches it to terminal B. Only B is now attached. WHY THIS WORKS AS AN ANSWER ------------------------------ It shows the three different behaviours side by side: -r refuses an attached session, -x shares it, and -d -r takes it over. The exact wording of screen's messages varies slightly between versions.