ptools - mini

Hello,
I`ve wrote a few tools (well four ;)) for gathering informations about processes. Those tools are based on functionality from Solaris ptools. And the tools are:

* pwdx - Display process working directory.

Code:
[root@freebsd ~]# pwdx
Usage: pwdx <pid>
[root@freebsd ~]# pwdx 1241
Root directory /jails/jail1 (process is in jail number 1)

* pldd - Display dynamic linker dependencies

Code:
[root@freebsd ~]# pldd
Usage: pldd <pid>
[root@freebsd ~]# pldd $$
4903: bash
/libexec/ld-elf.so.1
/lib/libncurses.so.8
/usr/local/lib/libintl.so.9
/usr/local/lib/libiconv.so.3
/lib/libc.so.7

* pargs - Display process arguments

Code:
[root@freebsd ~]# pargs
Usage: pargs <pid>
[root@freebsd ~]# pargs 930
Arg0  /usr/sbin/cron
Arg1  -s

* ptree - Display process hierarchy as a tree

Code:
[root@freebsd ~]# ptree -h
usage: ptree
-j <jail number>
-p <pid number>
no argument will show all processes
[root@freebsd ~]# ptree -p $$
4903 bash
  4917 ptree
[root@freebsd ~]# ptree -j 1
1234 sendmail
1241 cron

I know that those informations could be find via different tools but nevertheless maybe someone find them useful or funny ;). All the necessary files are here http://shewolf.com.pl/ptools
 
Thanks! There is now version 0.2 available, it has some bug fixes, code polishing and one new switch to the ptree. I will add more tools in version 0.3.
 
Back
Top