Pstree but without other children of ancestors

view story

http://www.unix.com – Hi, I want to display the process tree of a given PID, however, I don't want to see other children of the ancestors that don't reach the current PID. My goal is, from the tree result, i have to fetch a particular parent process by keyword, and if any other children from parents have the same name, it will give me incorrect results I used 'pstree -alhpA <pid>' but it displays the other children of the parents too Is there a easy way to achieve this without having to write a custom script to loop thru each PPID and reach the root? Thanks, -sri (HowTos)