如何在linux中查找父进程ID
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9707114/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find parent process id in linux
提问by user509755
I was looking for a linux command to find the parent process id. When I use the following command ps- ef | grep jboos
我正在寻找一个 linux 命令来查找父进程 ID。当我使用以下命令 ps-ef | grep jboos
It returns all process ids including chile and some other information. What I am looging for is to filter out child ids and other information and return only parent id. So that calling app can kill all the running processes by just killing parent.
它返回所有进程 ID,包括智利和其他一些信息。我正在寻找的是过滤掉子 ID 和其他信息并仅返回父 ID。这样调用应用程序就可以通过杀死父进程来杀死所有正在运行的进程。
Thanks
谢谢
回答by Ed Heal
回答by kclair
The l
(lowercase L
) option to ps
will add the PPID column to the output.
该l
(小写L
)选项ps
将PPID列添加到输出。