How to view the command line and environment variables for a process in the linux command line
I'd 开发者_如何转开发like to be able to see both the command line that launch a given process (by PID) and the its environment variables.
Preferably from a command line but a script would be acceptable failing that.
This would be on Centos 5.3 but the more widely it works the better.
cat /proc/$pid/environ cat /proc/$pid/cmdline
where $pid is the pid you are interested in
ps -ef
is a quick way to get the command line args for everything. grep to your hearts delight!
精彩评论