Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What's the FreeBSD (or Linux) equivalent to the 'pargs' command, available in Solaris? Many times I want to know what are the environment variables for a given process space, with no help from these systems.

share|improve this question
up vote 3 down vote accepted

Substitute the PID where "12345" is shown:

tr '\0' '\n' < /proc/12345/environ


ps eww -p 12345
share|improve this answer
Thank you! That helped me a lot. – anderson Sep 18 '10 at 2:11

Here's a complete solution using ps version 3.39 on Ubuntu:

ps eww -p 12345 | tail -n 1 | awk '{for(i=5;i<=NF;i++) printf( "argv[%s]: %s\n", i-5, $i ); }'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.