# Environment variables of a running process



## kurld (Nov 24, 2014)

Hi,

Need some help. How can I check an environment of a running process in FreeBSD?

What I'm looking for is basically an equivalent of:
`tr '\0' '\n' < /proc/`pidof [I]process[/I]`/environ` in Linux.

And a sample output (dhcpd here):​

```
METHOD=dhcp
MODE=start
LOGICAL=eth0
PHASE=pre-up
ADDRFAM=inet
VERBOSITY=0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
IFACE=eth0
PWD=/
```


----------



## kpa (Nov 24, 2014)

Look at procstat(1). For example:

`procstat -e <pid>`


----------

