Listing all child pid and deleting it in reverse order

Hi ,

My problem is that I am not able to list all process id of any process.

If you see pstree command it shows many process id under https. But if I run ps command its not listing all the process id for httpd.

It is just listing the PPID and immediate child process id only. I want to have all child process id.

Why pstree and ps command output is different.

Can someone point me in the right direction so that I can get all the child process id using other command rather than using pstree command.

Thank you

---------- Post updated at 09:08 PM ---------- Previous update was at 09:08 PM ----------

I have managed to write one line script to get the list all process id of HTTPD including PPID TGID and PID

You can avoid the 'grep -v grep' by altering the pattern so it doesn't match itself:

grep '[h]ttp'

you could also just do a killall httpd

@Mark : Yes that is what i know.

Why pstree and ps command output is different?

The pstree command shows processes and threads. The ps command by default only shows processes (ps -eLf shows threads as well)