bash 脚本没有出现在 ps aux 输出中:如何杀死?

发布于 2024-12-19 09:59:01 字数 461 浏览 3 评论 0原文

我已经对此进行了一些谷歌搜索,但没有找到答案......沮丧正在来临!

我想杀死我的 bash 脚本。这会执行各种其他进程。我可以杀死任何有 PID 的进程;但是 ps aux | grep myuserid 仅显示“其他进程”,而不显示脚本本身。

我怎样才能杀死脚本?也许这意味着“我如何获得脚本的 PID?”那我就可以杀了它。

谢谢,祝周末愉快(-:

m

PS,感谢您对之前问题的许多精彩答案……这对我来说是日常资源。无价的。


已解决! 好吧,当我在谷歌上搜索、挠头并咨询这里的综合专业知识时,测试('development=true)就自然而然地进行了。现在再次开始作为 nohup 作业,并将“development”标签设置为 false。这次我可以在 ps aux 上看到它 | grep 我的输出。叹息,这真是漫长的一天。

感谢所有提供答案的人,请继续。 享受周末。

I have done some googling on this but not come up with an answer ... frustration is setting in!

I want to kill my bash script. This executes various other processes. I can kill any process for which I have a PID; but ps aux | grep myuserid shows up only the 'other processes', not the script itself.

How can I kill the script? Perhaps this means 'how can I get a PID for the script?' Then I can kill it.

Thanks, and have a great weekend (-:

m

PS THANKS for the many great answers to previous questions here ... it's a daily resource for me. Invaluable.


SOLVED!
Well, the test ('development=true) it ran its natural course while I googled, head-scratched and consulted the combined expertise here. Now started again as a nohup job with the 'development' tag set to false. This time I CAN see it on the ps aux | grep me output. Sigh, it's been a long day.

Thanks to all that contributed answers, comme toujours.
Enjoy the weekend.

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

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

发布评论

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

评论(2

无人接听 2024-12-26 09:59:01

如果您知道恶意脚本的文件名,可以尝试 pgrep -f my_script_name。如果它有效,它会显示 pid。或者,您可以使用 pkill 直接尝试终止任何匹配的进程。

If you know your rogue script's file name, you might try pgrep -f my_script_name. If it works it will show you the pid. Alternately you can use pkill to directly try to kill any matching process.

述情 2024-12-26 09:59:01

我通常这样做:

killall scriptname

I usually do this with:

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