请参阅下面ps命令的输出:
abc@smaug:~/Desktop$ ps ax | grep firefox
2213 ? Sl 2:01 /usr/lib/firefox/firefox
2644 pts/0 S+ 0:00 grep --color=auto firefox请解释这两行,哪些进程id可以用来杀死firefox进程?
每次运行该命令时,进程id 2644都会继续更改。
发布于 2013-10-10 12:57:15
您必须杀死的firefox进程是:
2213 ? Sl 2:01 /usr/lib/firefox/firefox2644进程是您正在运行的grep命令,正如您正确提到的,它在每次运行它时都会更改他的ID。
发布于 2015-12-27 03:21:09
单线:
ps aux | grep firefo[x] | awk '{print $2}' | xargs killhttps://unix.stackexchange.com/questions/94430
复制相似问题