Environment variables (Linux)
Arch Wiki: environment variables
System-wide
/etc/profileis sourced by all POSIX-compatible shells upon login.- Files inside the
/etc/profile.d/directory will also be read.
Bash
~/.profileor~/.bash_profilefor login bash instances.~/.bashrcfor every interactive bash instance.
Zsh
~/.zshenvfor environment variables in all zsh instances.~/.zprofilefor every login zsh instance.~/.zshrcfor every interactive zsh instance.
Note
zsh does not source ~/.profile by default because of the difference between bash and zsh syntaxes. You can add this line to ~/.zprofile or ~/.zshenv to make zsh shells read `~/.profile correctly.
~/.zshenv
skip_global_compinit=1
test -r ${HOME}/.profile && emulate sh -c 'source ${HOME}/.profile'X Window
~/.xinitrcis sourced bystartx.~/.xprofileis sourced by display managers (e.g., GDM, SDDM)
Systemd and Wayland
~/.config/environment.d/*.conf: sourced bysystemd. Also, they are used in Wayland sessions wherexinitrcandxprofilefiles are not available.
Last updated on