I'm using MacOS Monterey 12.4. When I open zsh I get immediately
/etc/zshrc:7: command not found: locale/etc/zshrc_Apple_Terminal:104: command not found: mkdir
I understand that my terminal immediately executes the content of '/etc/zshrc' and '/etc/zshrc_Apple_Terminal' before it executes that of '~/.zshrc' in which I inserted the command
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
In fact after those files are loaded by the terminal every command is reachable since I can go
me@mylaptop ~ % which locale/usr/bin/localeme@mylaptop ~ % which mkdir/bin/mkdir
I tried to edit the files '/etc/zshrc' and '/etc/zshrc_Apple_Terminal' but I couldn't do it because the system says they are blocked even if I open their properties and change the rights for every group to read/write by opening the lock with the sudo password.