When I type env at the terminal prompt, I get a dump of all the environment variables. When I check / or ~, however, I do not see a .profile, .bash_login or .bash_profile.

Where is this being stored in Mac OS X 10.6.7 ?



3 Answers 3


It sounds like you are using bash.

bash first runs /etc/profile. /etc/profile (on Mac OS X 10.6.7) runs path_helper(8) which is where your default paths get set. After that it runs /etc/bashrc which doesn't do much. Once the default configuration is set, it moves on to the user login scripts.

bash looks in your home directory for .bash_profile, .bash_login, and .profile in that order. bash will run the first of these that it finds and stop looking.

  • Also, some variables come from launchd (e.g. TMPDIR, SHELL, HOME, USER, LOGNAME, SSH_AUTH_SOCK, DISPLAY, Apple_PubSub_Socket_Render), Terminal (e.g. TERM, TERM_PROGRAM, TERM_PROGRAM_VERSION, COMMAND_MODE) and bash itself (PWD, SHLVL). May 24, 2011 at 5:36
  • Thanks Chris! Out of curiosity - why are some of the variables associated with launchd ? The other ones make sense to me. May 30, 2011 at 7:38

Usually those files should reside in your /etc directory. In case when you don't have your local copy of say .profile then the system uses /etc/profile .

  • Thanks Tigran! That was interesting - I had searched for .profile, but I see that it is profile, as you have noted. May 30, 2011 at 7:40

Have a look at the following links. Some of them may help. ;)

  1. https://superuser.com/questions/182402/setting-environment-variables-mac-10-6
  2. https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x
  3. http://developer.apple.com/library/mac/#qa/qa1067/_index.html
  • Thanks! Unfortunately, the .plist file is not found on my system. Any reason that you can think of ? I'm running 10.6.7. May 23, 2011 at 11:35
  • Please explain something in the text and give information what the links are - as I assume blank links etc are to virus, phishing etc
    – mmmmmm
    May 23, 2011 at 11:42
  • @Mark - A good point. In this case, the links are safe. May 30, 2011 at 7:41
  • When the comment was written - the text just read link not the URI as it is now
    – mmmmmm
    May 30, 2011 at 10:36
  • Well, after @Marks comment I have edited the links to make it more transparent.
    – karmatic
    May 30, 2011 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .