Where is the default terminal $PATH located on Mac?

If you start at /etc/profile, it should look something like this:

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi

It's testing to see if the file exists and if so, executes it. If you execute it by hand, you'll get something like this:

PATH="/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"; export PATH;

I believe that's what you're looking for. So it comes from /etc/profile, which in turn calls an executable that sets the path.


If you do sudo man path_helper, it talks a bit about how it puts the path together. You might look in /etc/paths and /etc/paths.d. I did, and found what I was looking for.


Many system-wide settings including PATH are set in /etc/profile which is read in by bash at startup. On Mac OS X this file usually uses path_helper to set PATH. This utility in turn reads the information from other system configuration files under /etc (see path_helper manpage).

Note that even if you disable the reading of the initialization files by bash (e.g. with command-line options like --noprofile) it will still inherit the environment of the parent process.

Tags:

Macos

Bash

Path