假设我打开了很多屏幕,我想使用'screen -r'恢复到特定的屏幕会话 这是我执行screen -r时得到的 有几个合适的屏幕:
12670.pts-8.b-dev03 (Detached)
23662.pts-9.b-dev03 (Detached)
502.pts-1.b-dev03 (Attached)
19972.pts-1.b-dev03 (Detached)
9414.pts-24.b-dev03 (Attached)
16607.pts-1.p-dev03 (Detached)
3015.pts-2.b-dev03 (Detached)
14313.pts-18.b-dev03 (Attached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
如何恢复其中一个,让我们说最后一个附加的。 我试过了 -
screen -r 14313.pts-18.b-dev03
There is a screen on:
14313.pts-18.b-dev03 (Attached)
There is no screen to be resumed matching 14313.pts-18.b-dev03.
答案 0 :(得分:50)
措辞有点不走运 - 这是因为screen
附加了14313.pts-18.b-dev03
会话,你不能简单地“恢复”非分离会话。除了使用第二个-x
实例附加到此会话之外,您还需要使用screen
选项(或者,首先分离现有会话):
-x
Attach to a not detached screen session. (Multi display mode).
$ screen -xr 14313
如果您希望分离第一个会话:
-d -r
Reattach a session and if necessary detach it first.
$ screen -dr 14313