.profile vs .bash_profile in OSX

According to the manual page that ships with OS X:

… it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.

in summary: .profile works with sh or bash. However .bash_profile is bash-specific and will override .profile if present.

mac OS X environment checks .bash_profile, .bash_login, .profile in this order. It will run whichever is the highest in the hierarchy, so, if you have .bash_profile, it will not check .profile.

Advertisements

2 comments

  1. Pingback: set up mongo db in windows and osx | Life in USA
  2. reedbarber · February 10, 2015

    Reblogged this on Reed Barber.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s