如何为屏幕指定名称?

发布于 2024-09-08 18:50:07 字数 1818 浏览 2 评论 0原文

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

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

发布评论

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

评论(5

向地狱狂奔 2024-09-15 18:50:07

启动新会话

screen -S your_session_name

重命名现有会话

Ctrl+a, : sessionname YOUR_SESSION_NAME < kbd>输入

您必须在会话内

To start a new session

screen -S your_session_name

To rename an existing session

Ctrl+a, : sessionname YOUR_SESSION_NAME Enter

You must be inside the session

牵你手 2024-09-15 18:50:07

要创建名为 foo 的新屏幕,请使用

screen -S foo

Then 重新附加它,运行

screen -r foo  # or use -x, as in
screen -x foo  # for "Multi display mode" (see the man page)

To create a new screen with the name foo, use

screen -S foo

Then to reattach it, run

screen -r foo  # or use -x, as in
screen -x foo  # for "Multi display mode" (see the man page)
清泪尽 2024-09-15 18:50:07

如前所述,screen -S SESSIONTITLE 适用于启动带有标题 (SESSIONTITLE) 的会话,但如果您启动会话并稍后决定更改其标题。这可以通过使用默认键绑定来完成:

Ctrl+aA

其中提示:

Set windows title to:SESSIONTITLE

Change SESSIONTITLE by退格并输入所需的标题。确认名称更改并列出所有标题。

Ctrl+a"

As already stated, screen -S SESSIONTITLE works for starting a session with a title (SESSIONTITLE), but if you start a session and later decide to change its title. This can be accomplished by using the default key bindings:

Ctrl+a, A

Which prompts:

Set windows title to:SESSIONTITLE

Change SESSIONTITLE by backspacing and typing in the desired title. To confirm the name change and list all titles.

Ctrl+a, "

只想待在家 2024-09-15 18:50:07

最简单的方法是使用带有名称的 Screen:

screen -S 'name' 'application'
  • Ctrl + a, d = 退出并保持应用程序

打开返回到 Screen:

screen -r 'name'

例如,使用 Lynx 和 Screen。

创建一个屏幕:

screen -S lynx lynx

Ctrl+a, d = exit

稍后,您可以使用以下命令返回:

screen -r lynx

The easiest way is to use Screen with a name:

screen -S 'name' 'application'
  • Ctrl + a, d = exit and leave the application open

Return to Screen:

screen -r 'name'

For example, using Lynx with Screen.

Create a screen:

screen -S lynx lynx

Ctrl+a, d = exit

Later, you can return with:

screen -r lynx
江心雾 2024-09-15 18:50:07

我是 Screen 的初学者,但我发现它在恢复丢失的连接时非常有用。

您的问题已得到解答,但此信息可能作为附加信息 - 我使用 PuTTY使用 PuTTY 连接管理器并命名我的屏幕 - “tab1”、“tab2”等 - 对我来说,8-10 个选项卡的整体图片比每个单独的选项卡名称更重要。我使用第 8 个选项卡连接到数据库,第 7 个选项卡用于查看日志等。因此,当我想重新连接屏幕时,我编写了一个简单的包装器,其中显示:

#!/bin/bash
screen -d -r tab$1

其中第一个参数是选项卡编号。

I am a beginner to Screen, but I find it immensely useful while restoring lost connections.

Your question has already been answered, but this information might serve as an add on - I use PuTTY with PuTTY connection manager and name my screens - "tab1", "tab2", etc. - as for me the overall picture of the 8-10 tabs is more important than each individual tab name. I use the 8th tab for connecting to db, the 7th for viewing logs, etc. So when I want to reattach my screens I have written a simple wrapper which says:

#!/bin/bash
screen -d -r tab$1

where first argument is the tab number.

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