gpt4 book ai didi

bash - 如何使用 screen bash 命令解决这个问题?

转载 作者:行者123 更新时间:2023-11-29 09:16:04 26 4
gpt4 key购买 nike

我不小心删除了 /var/run/screen/S-root/25771.pts-0,当我再次尝试运行 screen 时

screen bash ...

它报告:

/var/run/screen/S-root/25771.pts-0: 没有那个文件或目录

我怎样才能恢复它?

最佳答案

检查你是否有环境变量STY设置:

[user@machine ~] echo $STY
25771.pts-0

如果设置了变量,那么你就是在告诉 screen重新附加到现有 session 。如果该 session 不存在,那么您将看到您遇到的错误。

要解决这个问题,只需通过运行清除环境变量:

export STY=

并尝试开始 screen再次。

这种情况的发生可能是因为您之前运行的 screen session (为您设置了 STY 环境变量)现在已经关闭。例如:

xterm
screen
# The following xterm will inherit the existing STY environment variable.
xterm &
# close the initial xterm, and in the new xterm run the following:
screen

最后调用 screen会给你你的错误,因为它仍然有环境变量 STY来自原始(现已消失)screen session 。

关于bash - 如何使用 screen bash 命令解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3118144/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com