Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
Created September 12, 2019 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zhiguangwang/3cdd041904bc3b27e521dcc5c7b1869b to your computer and use it in GitHub Desktop.
Save zhiguangwang/3cdd041904bc3b27e521dcc5c7b1869b to your computer and use it in GitHub Desktop.
Show the environment variables of a running process in Linux
sudo cat /proc/<pid>/environ | tr '\0' '\n'
@mikesart
Copy link

mikesart commented Oct 3, 2019

I've also found that using strings works well. Like this (using $$ is a nice quick way to test w/ bash):

strings /proc/$$/environ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment