gpt4 book ai didi

macos - 从命令行杀死所有进程

转载 作者:行者123 更新时间:2023-12-02 07:42:05 26 4
gpt4 key购买 nike

我想从命令行终止所有 Firefox 进程。

例如:

MacPro:huangr$ ps -x | grep 'firefox'
4147 ttys000 0:00.00 (firefox-bin)
4177 ttys000 0:00.00 (firefox-bin)
4234 ttys000 0:00.00 (firefox-bin)
4273 ttys000 0:00.00 (firefox-bin)
4282 ttys000 0:00.00 (firefox-bin)
4285 ttys000 0:00.00 (firefox-bin)
4298 ttys000 0:00.00 (firefox-bin)
4301 ttys000 0:00.00 (firefox-bin)
4304 ttys000 0:00.00 (firefox-bin)
4311 ttys000 0:00.00 (firefox-bin)
4317 ttys000 0:00.00 (firefox-bin)
4320 ttys000 0:00.00 (firefox-bin)
4338 ttys000 0:00.00 (firefox-bin)
4342 ttys000 0:00.00 (firefox-bin)
4377 ttys000 0:03.85 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground
4394 ttys000 0:05.54 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground
4471 ttys000 0:06.08 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground
4581 ttys002 0:04.92 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground
4607 ttys002 0:04.33 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground
4626 ttys002 0:05.04 /Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -foreground

我想一枪把他们全部杀掉,有什么简单的方法吗?谢谢。

最佳答案

kill -9 $(ps -x | grep 'firefox' | awk '{print $1}')

应该这样做

关于macos - 从命令行杀死所有进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8594653/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com