Linux终端屏幕CLI命令,用于通过其Windows终止(关闭)所有会话

问题描述 投票:0回答:1

有没有什么方法可以终止screen linux CLI工具的所有会话?

如果我按照他们列出

screen -ls

我得到:

There are screens on:
    31152.test  (08.10.2019 10:22:30)   (Detached)
    14361.pts-1.edd (08.10.2019 09:57:35)   (Attached)
2 Sockets in /run/screen/S-edd.

如果我没记错的话,可以使用此命令:

screen -X quit

用于终止所有会话,但现在它抱怨没有为其提供会话名称:

There are several suitable screens on:
    31152.test  (08.10.2019 10:22:31)   (Detached)
    14361.pts-1.edd (08.10.2019 09:57:36)   (Attached)
Use -S to specify a session.

我正在使用屏幕版本4.06.02(GNU)17年10月23日

linux terminal command-line-interface terminate
1个回答
0
投票

让所有会话都以此行终止:

screen -ls | head -n-1 | tail -n +2 | cut -d'(' -f1 | cut -f2 -d"    " | sed "s/$/ quit/g" | sed "s/^/screen -X -S /g" | sh

但是我仍然缺少一个简单的选项来终止所有会话...

© www.soinside.com 2019 - 2024. All rights reserved.