I am going to set the path for mySQl on my computer (I'm running Snow Leopard) but I see different instructions online.
Some say to change the .profile file and some say to change the .bash_profile file. What is the difference?
bash_profile. This file is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command line interface. Within it you can change your terminal prompt, change the colors of text, add aliases to functions you use all the time, and so much more.
bash_profile is read and executed when Bash is invoked as an interactive login shell, while . bashrc is executed for an interactive non-login shell. Use . bash_profile to run commands that should run only once, such as customizing the $PATH environment variable .
Go the users home directory. Check if the bash_profile is visible there or not. If not, press Command + Shift + . and bash_profile will be visible.
.profile
works with sh
or bash
. However .bash_profile
is bash-specific and will override .profile
if present.
I believe 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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With