退出时杀死 xterm 内启动的所有进程

发布于 2024-09-26 15:42:26 字数 216 浏览 0 评论 0原文

我正在使用 Cygwin 启动一些服务器。

每个服务器都在 xterm 中启动,并使用一系列如下命令:
xterm -e $my_cmd /C &

有没有一种简单的方法可以连续杀死所有启动的子项(xterm 及其运行命令)?

我还希望能够在关闭其父 xterm 时终止特定启动的命令。

有人知道如何执行该操作吗?

I'm using Cygwin to start some servers.

Each server is launched inside an xterm with a bunch of command like this one:
xterm -e $my_cmd /C &

Is there an easy way to kill all launched children (xterm and their running commands) in a row ?

I want also to be able kill a particular launched command when I close its parent xterm.

Someone knows how to perform that ?

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

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

发布评论

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

评论(1

余生再见 2024-10-03 15:42:26

杀死所有 xterm?该命令位于psmisc 包中。 Xterm 将在退出之前用 SIGHUP (“挂起”)通知其子进程。通常,这也会导致子进程退出,尽管有些服务器对该信号的解释不同。

killall xterm? That command is in the psmisc package. Xterm will notify its child process with a SIGHUP ("hangup") before it exits. Normally that will cause the child process to exit too, although some servers interpret that signal differently.

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