The Zsh shell is available for Linux but also the current default for macOS. The official documentation is available at ZSH - THE Z SHELL.
When logging into a interactive Zsh shell the following are executed in this order:
.zshenv
- always used and often contains environment variables, but note my comment on path below.zprofile
- same as .zlogin really.zshrc
- for interactive shell configurationThese files and their execution order is described at Moving to zsh, part 2: Configuration Files – Scripting OS X if you want more details. The path can be modified via an array and you can easily prevent duplicates, see A User's Guide to the Z-Shell, however, one thing I have found is that between the execution of .zshenv
and .zprofile
the path order is changed. This is explained in How $PATH is Constructed on macOS and can be summarised as follows:
There is a handy introduction to zsh at Zsh: the sheet | 111, which you might find useful.