'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 ); }'
Related videos on Youtube
Author by
anderson
Updated on September 17, 2022Comments
-
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.