-2

I do a lot of search on finding environment variables. When I use the command printenv. I see a lot of environment variables. But I can't find them in my MacOS system.

I tried to open ~/.bash_profile and ~/.zshenv. But nothing in there!

I want to know clearly, in some searches, they said, there are two kind of environment variables in this link

  • Temporary environment variables, for example, using command:
export PATH=/Users/user1/Documents/apache-maven-3.5.0/bin:$PATH

to add /Users/user1/Documents/apache-maven-3.5.0/bin to the PATH list

  • Permanent environment variables are stored at .bash_profile

Now I want to know in MacOS Monterey, which location used for storing temporary environment variables, which location used for storing permanent environment variables?

Alex
  • 30
  • 1
  • 5
  • Environment variables aren't stored anywhere (except transiently in RAM). Does the question ["Where are Terminal export variables saved in Macos"](https://stackoverflow.com/questions/61660721/where-are-terminal-export-variables-saved-in-macos) clarify how environment variables work (note that exported variables *are* environment variables)? – Gordon Davisson May 08 '22 at 17:11
  • Please give at least _one_ example! What's an environment variable that mystifies you? – matt May 08 '22 at 18:31

0 Answers0