OS X – .bashrc should be .bash_profile

Because this was driving me fricking insane today, and because my google searches weren’t helping – if you’re using osx and following someone else’s tutorial in an effort to add additional directories to your path, say for example because you’ve installed the portage system and you need the port command to be in your path, then ignore what 99% of what folks are saying – all my efforts to use the .bashrc file to do this led to nothing but me swearing colorfully. Simply cp’ing .bashrc to .bash_profile did the trick though. Why no one, including me, is stating this obviously I have no idea. I’m no bash expert. All I can say is making my edits in .bash_profile works and .bashrc did not.

I inferred the answer from this handy bash tutorial.

Oh and if you’re like me and you never want to see an ls without an -al, add this to your .bash_profile: alias “ls”=”ls -al”

0 thoughts on “OS X – .bashrc should be .bash_profile

  1. wilmer_t says:
    wilmer_t's avatar

    My friend,
    to the best of my knowledge, the problem you faced was due to the difference in between setting up a login shell, and setting up an executable shell
    That is, for a login shell there should always be a .bash_profile in your home directory
    But, the configurations and tweaks to standard environment (i.e. /etc/bashrc and /etc/profile) should be defined in the .bashrc
    You then simply add a source of the .bashrc from within the .bash_profile, along with other posisble modifications to be applied only at login (and not for any shell invoked during your login session
    In short:
    .bashrc is read every time a new process is started
    .bash_profile only at login
    /WT
    …h

    Like

Leave a comment