开发者

How to view the command line and environment variables for a process in the linux command line

开发者 https://www.devze.com 2023-01-25 08:18 出处:网络
I\'d 开发者_如何转开发like to be able to see both the command line that launch a given process (by PID) and the its environment variables.

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

精彩评论

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