如何恢复挂起的外壳?

Tim*_*Tim 3 shell bash

$ help suspend
suspend: suspend [-f]
    Suspend shell execution.

    Suspend the execution of this shell until it receives a SIGCONT signal.
Run Code Online (Sandbox Code Playgroud)

我应该如何向suspend在 gnome 终端选项卡中挂起的外壳发送 SIGCONT 信号?

typ*_*ast 7

发送 SIGCONT

恢复挂起的 shell 的唯一方法是发送SIGCONT信号,大概是来自另一个 shell。您需要知道 shell 的 PID(进程 ID)。

kill -cont $shellpid
Run Code Online (Sandbox Code Playgroud)

如果您还不知道 PID,请尝试以下操作:

ps x | grep bash
Run Code Online (Sandbox Code Playgroud)

例如,当我暂停我的外壳时,我看到了这个ps x | grep bash

 6147 pts/14   S+     0:00 grep --color bash
 6172 pts/14   Ss     0:01 /bin/bash
15085 pts/0    Ss+    0:00 /bin/bash
15121 pts/12   Ts+    0:01 /bin/bash
Run Code Online (Sandbox Code Playgroud)

看看第三列。您想要的外壳是带有 的外壳T,并且该外壳的 PID(第一列)为 15121。当然,您的情况下的 PID 会有所不同;这只是一个例子。一旦找到 PID(假设它15121),然后运行:

kill -cont 15121
Run Code Online (Sandbox Code Playgroud)


Mik*_*kel 6

以同样的方式与任何其他挂起的进程:与fg%或任何其他类似的作业控制内置。

zsh% bash
bash$ suspend
zsh: suspended (signal)  bash
zsh% jobs
[1]  + suspended (signal)  bash
zsh% fg
[1]  + continued  bash
bash$
Run Code Online (Sandbox Code Playgroud)