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

On my linux system (ubuntu), when I create a certain alias in ~/.bashrc and then restart the terminal/system, the alias always works again, without reloading anything.

But on my MAC system, when I create the same alias in the same file, it only works in the current terminal session, but not anymore after restarting the terminal. I need to do source ~/.bashrc to get it loaded again.

Question: How/where do I create the alias in my MAC system so that it always works, without reloading anything?

share|improve this question
up vote 2 down vote accepted

Put the following in .bash_profile:

if [ -f ~/.bashrc ]; then
        . ~/.bashrc

Depending on how the terminal is launched, it will run either .bash_profile or .bashrc.

If you want the alias to be available everywhere it needs to run with the login terminal which loads the profile.

share|improve this answer

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.