command pstree PID can show all subprocess information of the process specified by PID. However, I also want to know all parent process information of the process PID, how can I get it?
An example, give below process:
init |- parent_process | `- current_process | |- subprocess_1 | `- subprocess_2 `- other_process
What I want is when I run pstree current_process_pid, I want to get below output
init
`- parent_process
`- current_process
|- subprocess_1
`- subprocess_2
When I run pstree subprocess_1_pid, it will output
init
`- parent_process
`- current_process
`- subprocess_1
Thanks in advance
ps -ef? – gks Oct 12 '12 at 4:07