5

In Unix/Linux terminology, do child processes of a process include grandchild processes of the process?

2 Answers 2

6

No, a child process B is a process created by some other process A. Since children of B are not created by A, they are not children of A. See also the wikipedia page.

(And fortunately there is always just a single parent, so there is no chance of incest)

3

The processes are arranged in a tree, which you can display with pstree. By definition, every process except 0 (PID 1, aka. init) has a single parent. For example, in this process tree gnome-session has three children and four descendants (including the right-most nm-applet), plus one parent (as per the definition) and three ancestors (lightdm twice and then init):

init─┬─lightdm─┬─Xorg
     │         ├─lightdm─┬─gnome-session─┬─awesome
     │         │         │               ├─nm-applet───{nm-applet}
     │         │         │               ├─ssh-agent
     │         └─2*[{lightdm}]
...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .