开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜