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

发布于 2024-09-06 20:36:15 字数 222 浏览 7 评论 0原文

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

screen bash ...

它报告:

/var/run/screen/S-root /25771.pts-0: 没有这样的文件或目录

如何恢复它?

I accidently deleted /var/run/screen/S-root/25771.pts-0 and when I try to run screen again

screen bash ...

it reports:

/var/run/screen/S-root/25771.pts-0: No such file or directory

How can I recover it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

指尖上的星空 2024-09-13 20:36:15

检查您是否设置了环境变量 STY

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

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

要解决此问题,只需通过运行以下命令清除环境变量:

export STY=

并尝试再次启动 screen

发生这种情况的原因可能是您之前运行了一个屏幕会话(为您设置了 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 的最终调用将会给您带来错误,因为它仍然具有原始(现已消失)screen中的环境变量 STY代码>会话。

Check to see if you have the environment variable STY set:

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

If the variable is set, then you are telling screen to reattach to an existing session. If that session doesn't exist, then you will see the error you are getting.

To solve this, just clear the environment variable by running:

export STY=

and try starting screen again.

This scenario may have occurred because you previously had a screen session running (which setup the STY environment variable for you) which has now closed. For example:

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

The final call to screen will give you your error, because it still has the environment variable STY from the original (now-gone) screen session.

才能让你更想念 2024-09-13 20:36:15

这意味着您已经在名为“bash”的屏幕中,

只需使用“exit”命令退出即可。再次运行“screen bash”

It means you are already in screen named "bash"

Just exit it with "exit" command. And run again "screen bash"

帝王念 2024-09-13 20:36:15

恕我直言,如果您删除了屏幕套接字,则无法恢复该屏幕实例。

您必须退出屏幕并再次运行它。

IMHO if you deleted the screen socket, there is no method to recover that screen instance.

You have to exit from screen and run it again.

痴梦一场 2024-09-13 20:36:15

如果您找不到要退出或终止的会话,并且每次尝试启动 screen 时都会出现相同的“没有此类文件或目录”错误,请尝试“screen -wipe”。

If you don't find a session to exit or kill and get the same "No such file or directory" error every time you try to start screen, try "screen -wipe".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文