pst is a command-line utility that creates visual trees of your running processes on Unix-like systems.
pst is a reproduction of pstree, written in Python.
pst currently supports Python 2.x-3.x.
$ sudo pip install pst
First clone the pst repository and go into the directory.
$ git clone git://github.com/topunix/pst.git
$ cd pst
Then run the command below.
$ sudo python setup.py install
If you don't have root permission (or don't want to install pst with sudo), try:
$ python setup.py install --prefix=~/.local
$ export PATH=~/.local/bin:$PATH
pst shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown
Display a help message
Display the version of pst
Directs the output to a file name of your choice
When specified, pst writes to stdout. By default, pst uses less to page the output.
Show only trees rooted at processes of this user
Start at this pid; default is 1 (init)
Demos speak more than a thousand words! Here's me running pst on ubuntu. As you can see, you can select a pid and see its child processes:
shell>
shell> pst
shell> pst --help
shell> pst -o trees.txt
shell> pst --user postgres