【FreeBSD】查看一个运行进程的环境变量

Posted by 西维蜀黍 on 2021-05-04, Last Modified on 2021-09-21

procstat

$ procstat -e <pid>


$ procstat -e 1906
  PID COMM             ENVIRONMENT
 1906 smbd             LANG=en_US.UTF-8 PATH=/sbin:/bin:/usr/sbin:/usr/bin PWD=/ HOME=/ RC_PID=1899

ps

$ ps -p <PID> -wwwe

$ ps -p 1906 -wwwe
 PID TT  STAT    TIME COMMAND
1906  -  Is   0:00.36 LANG=en_US.UTF-8 PATH=/sbin:/bin:/usr/sbin:/usr/bin PWD=/ HOME=/ RC_PID=1899 /usr/local/sbin/smbd --daemon

Reference