Earlier this week, I went to setup aliases on Mac OS X (Mountain Lion) and couldn’t get the terminal to read the .bashrc file. It turns out that Mac OSX loads .bash_profile instead of .bashrc.

So I spent some time searching and found out that OSX will check a few files for additional shell config

~/.bash_profile, ~/.bash_login, and ~/.profile

Note: The files are also read in the order above. If you have a .profile file and a .bash_profile, the .profile config will be ignored.

I’m used to using .bashrc for everything so to get around my habit, I just added the following lines to .bash_profile.

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

Now, I just carry on like I always did!

I’m sure that the same .bashrc fix will apply to Lion and Snow Lepord as well.

By | 2012-08-24T20:12:35+00:00 August 24th, 2012|Apple|0 Comments

About the Author:

Korske is a Canberra-based adventurer, entrepreneur and photographer passionate about inspiring the heart of adventure in young people. He is the Director of World Photo Day, an international event that embraces a passion for photography and its ability to inspire communities. Away from the screen, you'll find Korske out Surfing, Snowboarding, Mountain Biking, Hiking, Rock Climbing and Wood Working.

Leave a Reply