Linux

Where Is the Linux environment File?

Linux /etc/environment file with system-wide variable assignments for all users.

Last updated

Linux sets system-wide variables from /etc/environment at login through PAM, applying to every user and desktop session. PATH tweaks, locale overrides and proxy defaults belong here.

The file takes plain assignments only, no shell expansions. Per-user overrides go in shell rc files that load later.

Where Linux stores this, by platform

Linux
/etc/environment

System-wide KEY=VALUE assignments read at login, no expansions or scripting allowed. Edit as root and re-login to apply. User shells override these values in their own rc files afterward.

Frequently asked questions

How do I set a variable for all Linux users?

Add a plain assignment to the file above and re-login. Shell expansions will not work there by design.

environment versus profile.d?

The file above sets PAM-level variables for every session type, while /etc/profile.d scripts run shell code for login shells only.

Notice an outdated path? Let us know.