When I open a new Terminal, the $PATH is not what I set in .zshenv

grep -i path .??* shows that no other dot-file sets the path.

Adding a couple of echo, I see:

Last login: Thu Nov 18 13:29:13 on ttys000
PATH: /usr/bin:/bin
path: /usr/bin /bin
WGroleau@MBP ~ % echo $PATH
WGroleau@MBP ~ % cat .zshenv
echo "PATH: $PATH"
echo "path: $path"
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export PATH=~/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
WGroleau@MBP ~ % 

/Library/Apple/usr/bin doesn't even exist!  From the comment, I guess it's something Apple removed in 12.0.1

  • RE: "/Library/Apple/usr/bin doesn't even exist!" -- What version of macOS are you running? I'm asking because it exists on my system running macOS Catalina and macOS Big Sur. Nov 18, 2021 at 22:03
  • Add set -x to your .zshenv, so it'll print what's happening in the init files and you can see where the additions are taking place. Nov 19, 2021 at 2:02
  • What is in /Library/Apple/usr/bin ? Maybe it's a bug that Apple moved it and failed to change whatever puts it on the path.
    – WGroleau
    Nov 19, 2021 at 2:11

1 Answer 1


From Gordon's comment, I found two disconcerting things:

  1. -x shows about a hundred actions for EVERY command entered.

  2. /etc/zprofile is called AFTER the user's .zshenv to change the path using a compiled executable in /usr/libexec/path_helper, which overrides ~/.zshenv by reading files /etc/paths and /etc/paths.d/*

So, no telling whether it's an Apple bug or whether some third party screw-up did it. The man page does say that I can override the damage in ~/.zprofile

You must log in to answer this question.

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