Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is /etc/paths read by every shell that I run in OS X? For example, if I use zsh, will it parse /etc/path to populate $PATH?

What exactly is the sequence that OS X follows to populate $PATH? Does it do it differently than other Unices?

share|improve this question
Yes, apparently it uses some file called /etc/path :). This is not a standard *nix thing so that file is probably called from one of the standard ones. Try grep path /etc/bash.bashrc /etc/profile /etc/zsh/* that should return the line that calls /etc/path. – terdon Jan 29 '14 at 17:03
up vote 4 down vote accepted

The OSX devs have implemented their own way of setting up the $PATH which is different from all other Unices as far as I know. They use a program called path_helper which will read /etc/paths and the files in /etc/path.d and modify the user's default $PATH accordingly.

According to this, the $PATH is only set this way for login shells. This is probably why iTerminal starts login shells by default (I've always wondered why they chose that).

According to the same source, path_helper is run from /etc/profile and /etc/csh.login which should affect

  • bash login shells
  • csh login shells
  • zsh login shells (should read /etc/profile)
  • all other shells that source /etc/profile which should be most login shells.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.