bash 脚本没有出现在 ps aux 输出中:如何杀死?
我已经对此进行了一些谷歌搜索,但没有找到答案......沮丧正在来临!
我想杀死我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您知道恶意脚本的文件名,可以尝试
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 usepkill
to directly try to kill any matching process.我通常这样做:
I usually do this with: