Why are some processes shown in pstree not shown in ps -ef?
As a header, I am running the above commands in a Linux shell, but I just cannot find the child processes pid 7459 by running "ps -ef | grep dummy". Can someone explain why there might be such a difference between these two commands? These are active processes, not LWP (thread), right? How can I display streams, btw?
sh-3.2$ pstree -p 7459
dummy(7459)-+-{dummy}(7508)
|-{dummy}(7528)
|-{dummy}(7529)
|-{dummy}(7530)
|-{dummy}(7551)
|-{dummy}(7552)
|-{dummy}(7553)
`-{dummy}(7554)
sh-3.2$ ps -ef | grep dummy
root 7459 7167 0 Aug28 ? 00:09:13 /usr/bin/dummy
erv 23720 17254 0 13:22 pts/4 00:00:00 grep dummy
sh-3.2$
source to share
As @nos said, pstree
displays streams by default, but ps -ef
doesn't work.
ps
can show streams, you just didn't ask about it. Try it (it may depend on which version you have):
ps -eLf
It's all on the page.
Linux linuses are simply processes that use the same address space as another process. It's like a fork that doesn't come off cleanly. You can read more in the clone
syscall documentation .
source to share