Skip to content

Instantly share code, notes, and snippets.

@saurabh500
Created July 24, 2020 19:42
Show Gist options
  • Save saurabh500/43fd2677f758e4de485de681aedb8a56 to your computer and use it in GitHub Desktop.
Save saurabh500/43fd2677f758e4de485de681aedb8a56 to your computer and use it in GitHub Desktop.
Check environment variables in Linux for a process

Find the process id for which the environment variables need to be found

ps faux | grep 'your_process'

Result saurabh 11654 0.6 3.0 3773360 243208 pts/1 Sl 10:33 0:47 /usr/lib/jvm/java-8-openjdk-amd64/bin/java

Get the PID of the process which is 11654 in the case above

cat /proc/11654/environ

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