Starting with Leopard, the program
/usr/libexec/path_helper was introduced to help manage the $PATH environment variable.
It is started by the
1 2 3
path_helper is called, it searches various files, looking for new paths to add…
- it first reads from the file
- then reads files under the folder
- and finally, oddly enough, the initial value of $PATH (prior to calling path_helper) is appended
Under the hood:
- path_helper only appends unique paths, so duplicates are avoided
- files from
etc/paths.dare read in alphabetical order by filename
- the default value for $PATH (prior to calling path_helper) is
- the default contents of file
1 2 3 4 5
How do I add more Paths ?
To add custom paths, you should create a plaintext file containing new paths (one per line) and place the file under the folder
/etc/paths.d. Remember to end file with a newline!
Or from the terminal you can:
How do I make Homebrew happy ?
brew doctor commonly complains that
/usr/bin is in your PATH before Homebrew's bin.
To fix this, move
/usr/local/bin to the top of list in
NOTE: The above changes are system-wide and will affect all users. If you only want to modify $PATH for a specific user, edit