By default, OS X 10.6 uses /usr/libexec/path_helper
to add the following paths listed in the file /etc/paths
:
/usr/bin /bin /usr/sbin /sbin /usr/local/bin
This means that /usr/bin
comes before /usr/local/bin
on the path. This results in the version of git installed by Xcode 4 in /usr/bin
to be called instead of the version installed by Homebrew into /usr/local/bin
.
Which leads me to my question, is there a problem with having /usr/local/bin
come before /usr/bin
in the path? Is there a specific reason that Apple defaults to having /usr/bin
come before /usr/local/bin
?
/usr/bin
and /usr/local/bin
Is it a problem to move /usr/local/bin
from the bottom of the file /etc/paths
to the top? Doing so would impact the path for more than just when I fire up Terminal, since /usr/libexec/path_helper
could be used by other resources (I'm uncertain about this).
While redundant, it seems safer for me to add /usr/local/bin
to the path in ~/.bash_profile
, which would mean that /usr/local/bin
would be on the path twice.
-- /usr/bin This is the primary directory for executable programs. Most programs executed by normal users which are not needed for booting or for repairing the system and which are not installed locally should be -- /usr/local/bin Binaries for programs local to the site.
It refers to a directory that contains executable commands for your application. Access to the Bin folder can help you change license and configuration files.
/bin contains executable files that are part of the core operating system. These files need to be accessible before /usr gets mounted. (for instance, the mount command is in /bin/mount ). /usr/bin contains executable files that are not part of the core operating system.
No, and no. They're just weird ... local by definition should override.
I had trouble with same problem, and found the link below from googling.
https://discussions.apple.com/thread/3588837?start=0&tstart=0
They said that modifying /etc/paths is not a good idea for security reasons.
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