tl; dr version: use ~/.zshrc
And read the man page to understand the differences between the two:
~/.zshrc , ~/.zshenv and ~/.zprofile .
Regarding my comment
In my comment on the answer kev gave , I said:
This seems wrong - / etc / profile is not listed in any zsh documentation I can find.
This turns out to be partially wrong: /etc/profile can be obtained using zsh . However , this only happens if zsh "is invoked as sh or ksh "; in these compatibility modes:
Normal zsh startup / shutdown scripts are not executed. Enter the shell source code / etc / profile followed by $ HOME / .profile. If the ENV environment variable is set during the call, $ ENV is obtained after the profile scripts. ENV is subject to parameter expansion, command substitution, and arithmetic expansion before being interpreted as a path. [ man zshall, "Compatibility" ].
ArcWiki ZSH Link says:
When logged in, Zsh sends the following files in the following order:
/ Etc / profile | This file is created by all Bourne-compatible shells upon login.
This means that /etc/profile always read by zsh at login - I have no experience with an Arch Linux project; Wikis may be correct for this distribution, but this is usually not the case. Information incorrect compared to zsh man pages and doesnโt seem to apply to zsh on OS X (the paths in $PATH set in /etc/profile do not fall into my zsh sessions)
To ask a question:
where exactly should I host my rvm, python, node, etc. additions to my $ PATH?
Normally, I would export my $PATH from ~/.zshrc , but itโs worth reading the zshall man page, in particular, the section "STARTUP / SHUTDOWN FILES" - ~/.zshrc is read for interactive shells that may or may not suit your needs - if you want $PATH for every zsh shell you zsh (both interactive and not both login and no, etc.) then ~/.zshenv is the best option.
Is there a specific file that I should use (e.g. .zshenv, which currently does not exist in my installation), one of the ones that I am currently using, or does it even matter?
There is a bunch of files read at startup (check the related man pages), and there is a reason for this: each file has its own special place (settings for each user, settings for user settings for login systems, settings for each shell, etc. d.).
Don't worry about ~/.zshenv not existing - if you need it, do it and it will be read.
.bashrc and .bash_profile are not considered read by zsh unless you explicitly use them from ~/.zshrc or the like; The syntax between bash and zsh not always compatible. Both .bashrc and .bash_profile are for bash settings, not zsh .