5

I have edited /private/etc/paths to allow access for Homebrew:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

I want to restore this file to the system Defaults. What are the default lines and default order?

3 Answers 3

13

The default content of /etc/paths until Mavericks (10.9) is:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

The default content of /etc/paths since Yosemite (10.10) is:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
2

In OS X 10.11 ( El Capitan ) the order and content of /etc/paths is:

 /usr/local/bin
 /usr/bin
 /bin
 /usr/sbin
 /sbin

Additionally, having installed Xquartz via MacPorts, I note the addition of one entry in /etc/paths.d/ called 40-XQuartz, which contains the following:

 /opt/X11/bin

As I recall, convention has it that /etc/paths is evaluated first, with any entries in /etc/paths.d being appended. Some optional / additional package managers make modifications to either the .profile or .bashrc at the root level of your user's home directory.

Are you having problems with the PATH variable related to optional / additional package managers like home-brew?

Warm Regards,

F.

1
  • Thanks for your reply! The reason I wanted to revert to default is because I decided to export the path in .bash_profile instead via: export PATH="/usr/local/bin:$PATH". I too have XQuartz installed, but I don't have /opt/X11/bin in /private/etc/paths nor .bash_profile. When running which xquartz it says /opt/X11/bin/xquartz. So I'm assuming that is appended from etc/paths.d automatically like you said.
    – P A N
    Commented Nov 14, 2015 at 18:59
1

Chiming for an update, since I have my doubts: as of 13.4 /etc/paths is

/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin

as well as a couple entries in /etc/paths.d/:

10-cryptex      40-XQuartz      at.obdev.littlesnitch
100-rvictl      Wireshark       mono-commands

I believe some of these aren't pristine, namely the non-numbered ones.

I was trying to see if that system was usable to insert Homebrew's paths globally, but as it turns out /usr/sbin/path_helper generates PATH by reading /etc/paths then files in /etc/paths.d in order, so you have no way of inserting something in front.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .