I really like the way
ps -T PID works on AIX. It shows you a nice tree of processes in the right side, and their PID, PPID and other info in the left side. In AIX docs, the
-T flag reads Displays the process hierarchy rooted at a given pid in a tree format using ASCII art.
Example: ps -T 40632
40632 - 0:00 |\--telnetd 40232 pts/2 0:00 | \--ksh 32910 pts/2 0:00 | \--dbx 987990 pts/2 0:00 | \--a.out
pstree, is there a way to get the same (or slightly different) output using Linux's
ps? It doesn't matter if post-processing of the results is required (using
grep, etc...), I just want a way to show the results like the AIX's version, that is, generating a tree of processes showing the PID, the childs, the children's childs, and so on. Besides the fact that Linux's
ps -T does not show the format I want, it only output the proceses directly related with the PID (PID + direct childs).
I have tried
pstree, but can't make it look like this at all - seems like it only support to have the PID printed beside the name of the process and its arguments, but can't print those in another pane, like AIX's version does.
By the way, I'm using
Debian 3.2.35-2 x86_64 GNU/Linux and
procps-ng version 3.3.3