Last Updated: September 09, 2019
·
1.382K
· jazzbonec

Places to save Environment Variables on Mac

This is just a note to remind myself of where to go to save environmental variables on Mac. Had a bit of a search trying to share a set up with a colleague today.

  1. ~/.MacOSX/environment.plist - OS X supports the definition of environment variables in the scope of the current user session. On login, the loginwindow application looks for a special property list file with the name environment.plist. This file must be located in a directory called .MacOSX at the root of the user’s home directory.

  2. ~/.profile -

  3. ~/.bashrc -

  4. ~/.bash_profile - These all seem the same in that they must be created in your home directory and they are, like environment.plist,, are specific to your user.

  5. /etc/launchd.conf - Environment variables set in launchd will be available to all programs on the system. However since $HOME/.launchd.conf is not supported, this approach is used for global environment variables only.