'pargs' command in FreeBSD or Linux

5,828

Solution 1

Substitute the PID where "12345" is shown:

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

or

ps eww -p 12345

Solution 2

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:
5,828

Related videos on Youtube

anderson
Author by

anderson

Updated on September 17, 2022

Comments

  • anderson
    anderson almost 2 years

    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.