0

Is there any command to display all the Environment variables stored in my unix?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • Do you mean env? You can sort the output with env | sort. – mnille Jul 11 '16 at 06:37
  • You probably misstated a little. You don't really want "all the Environment variables stored in my unix". Each process has it's own environment variables, which are passed to children. So you probably really wanted the environment variables of your shell. However, you can get all the environment variables of all the processes with ps eww -e (note ps versions differ you may need to RTFM), note this will be really big (on my server it's 26,577 characters). – MAP Jul 11 '16 at 23:46

1 Answers1

4

You can use printenv or env. See this post for the differences:

What is the difference between 'env' and 'printenv'?

Vombat
  • 12,884
  • This displays all active environment variable, getting all stored ones (if that is what is wanted) is tricky. (for where could they be stored? answer: anywhere). I Hope though that getting a list of active ones is what you want. – ctrl-alt-delor Jul 11 '16 at 08:35