Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I think I managed to break my Snow Leopard shell, but I'm not sure. Is there a way to reset all env variables to default?

share|improve this question
What exactly did you do? – John T Jan 7 '10 at 8:09
And what is the error? – Felix Jan 7 '10 at 8:22
I was trying to install Sphinx4 from src. I changed a whole bunch of env variables to use the specific java library, but in the process made some bad changes so now no java program runs. – mechko Jan 7 '10 at 10:03
up vote 1 down vote accepted

Close terminal and re-open a new one. Any environments variables you set in the last session will be gone.

If the problem persists, you probably edited ~/.bashrc or ~/.bash_profile; edit them again and remove any changes (or if you want to get right back to the default OS X state, just remove them completely - a default OS X install has these files empty or non-existent).

share|improve this answer

One of the following:

  • Exit the shell and start it again.
  • Log out and log in.
  • . /etc/bash.bashrc
  • . ~/.bashrc
  • exec bash -i

The two that start with "dot" source your startup files which will reset some of your environment variables (but may make your $PATH variable longer - probably with no consequences).

share|improve this answer
Isn't it ~/.bashrc, not ./bashrc? – grawity Jan 7 '10 at 13:37
Thanks, it's a typo. Fixed. – Dennis Williamson Jan 7 '10 at 14:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.