# ptools - mini



## tmw (Mar 2, 2013)

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.


```
[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


```
[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  


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

* ptree -  Display process hierarchy as a tree 


```
[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


----------



## vermaden (Mar 3, 2013)

Nice, You should create 'regular' port of that


----------



## tmw (Mar 4, 2013)

Thanks. By regular port you mean in the official ports?


----------



## SirDice (Mar 4, 2013)

Yep, create a port and submit it.

FreeBSD Porter's Handbook


----------



## tmw (Mar 6, 2013)

Hello,
Ptools are now available in the ports collection 

sysutils/ptools


----------



## jnbek (May 2, 2013)

Nice Work!


----------



## tmw (May 9, 2013)

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.


----------

