Updating the PATH on the OSX CLI
Whether you use bash, csh, tcsh or zsh (my choice), it's not the most straight forward thing to update your path to search /usr/local/bin/
for scripts before using what's in /usr/bin/
. I had some nice .zprofile
fu going on to cleanly apply $PATH entries without duplicates, but no matter what ordering I used I would always have my local path appear after the system path.
Turns out OSX has something called /usr/libexec/path_helper
the "help" you have a headache.
The solution in the end was to edit /etc/paths
and reorder the lines in there to look like this:
$ cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Now any new shells you open will search /usr/local/bin/
before /usr/bin
.
Written by Jinn Koriech
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#