我有一个在ubuntu服务器上运行的多个屏幕,它们被启动为:
screen -dmS screen1 cmd screen -dmS screen2 cmd etc...
我需要杀死一个屏幕,但不是全部.使用其名称杀死单个特定屏幕的正确命令是什么?我已经阅读了man pages,但我似乎无法找到我正在寻找的命令.
此外,我想将此命令写入bash脚本,因此我不能简单地屏幕-r screen1然后像往常一样按Ctrl X.
从手册页:
原文链接:https://www.f2er.com/bash/386039.html-X Send the specified command to a running screen session. You can use the -d or -r option to tell screen to look only for attached or detached screen sessions. Note that this command doesn't work if the session is password protected.
你可以做 :
screen -X -S <sessionid> kill