Setup of environment variables for bash, zsh, fish, as well as Windows.
Also see Arch Wiki | env. variables.
For all users
/etc/profileis sourced by all POSIX-compatible shells upon login.
~/.bash_profilefor login bash shells.
~/.bashrcfor every bash instance.
~/.zshenvfor environment variables in zsh.
~/.zprofilefor login zsh shells.
~/.zshrcfor every zsh instance.
⚠️ zsh does not read
~/.profile by default due to syntax difference. You can do this instead in
~/.pam_environment: only supports
⚠️ Sourcing from
~/.pam_environment is being deprecated.
~/.config/environment.d/*.conf: files are read by systemd in the WayLand session.
~/.xinitrcis sourced by
~/.xprofileis sourced by display managers (e.g. GDM, SDDM)
set. They will vanish once the shell is closed.
Environment Variablesin the
Advancedsystem settings GUI in the control panel.
setx /?for the complete options