ZProfile
zprofile is a startup file used by the Z shell (zsh) to configure the environment for login shells. It is read after zshenv/zshenv for login sessions and is typically located at ~/.zprofile for user-specific settings, with a system-wide counterpart at /etc/zprofile. The primary purpose of zprofile is to establish environment variables and other settings that should apply to the login process, rather than to interactive command-line features.
In the zsh startup sequence, a login shell reads several files in a defined order. First, /etc/zshenv
Common usage examples include setting or exporting environment variables, configuring PATH, defining language and locale settings,
- export PATH="$HOME/bin:/usr/local/bin:$PATH"
It is also common to source additional files from zprofile, or conditionally load settings only in a
Notes: zprofile is not read by non-login or non-interactive shells, so other configuration (such as aliases and