Mac PATH: Difference between revisions
Line 12: | Line 12: | ||
=<tt>/etc/paths.d</tt>= | =<tt>/etc/paths.d</tt>= | ||
This directory contains the list of files. Each of the files contains the path that needs to be added to the PATH variable. The order in which the values are added is given by the alphanumeric order of the file names. The value specified in a <code>10-something</code> file will show up before the value specified in <code>20-soemethingelse</code>. The primary reason that <code>/etc/paths.d</code> directory is used because <code>/etc/paths</code> will be modified and/or replaced by system upgrades while contents of <code>/etc/paths.d</code> directory will never be affected by such changes. | This directory contains the list of files. Each of the files contains the path that needs to be added to the PATH variable. The order in which the values are added is given by the alphanumeric order of the file names. The value specified in a <code>10-something</code> file will show up before the value specified in <code>20-soemethingelse</code>. The paths specified here work for all users. The primary reason that <code>/etc/paths.d</code> directory is used because <code>/etc/paths</code> will be modified and/or replaced by system upgrades while contents of <code>/etc/paths.d</code> directory will never be affected by such changes. |
Revision as of 03:16, 6 January 2022
External
Internal
Overview
On Macs, the value of the PATH
variable is built by the path_helper
utility from the content of the /etc/paths
file and the /etc/paths.d
directory.
/etc/paths
The file contains the paths that need to be set in the PATH
environment variable, one per line, in the order in which to show up in the environment variable value. The paths specified here work for all users.
/etc/paths.d
This directory contains the list of files. Each of the files contains the path that needs to be added to the PATH variable. The order in which the values are added is given by the alphanumeric order of the file names. The value specified in a 10-something
file will show up before the value specified in 20-soemethingelse
. The paths specified here work for all users. The primary reason that /etc/paths.d
directory is used because /etc/paths
will be modified and/or replaced by system upgrades while contents of /etc/paths.d
directory will never be affected by such changes.