Halo
发布于 2023-02-28 / 76 阅读 / 0 评论 / 0 点赞

系统变量设置

/etc/environment

List of unique assignments. Allows references. Perfect for adding system-wide directories like /usr/local/something/bin to PATH variable or defining JAVA_HOME. Used by PAM and systemd.

/etc/environment.d/*.conf

List of unique assignments. Allows references. Perfect for adding system-wide directories like /usr/local/something/bin to PATH variable or defining JAVA_HOME. The configuration can be split into multiple files, usually one per each tool (Java, Go, and Node.js). Used by systemd that by design do not pass those values to user login shells.

/etc/xprofile

Shell script executed while starting X Window System session. This is run for every user that logs into X Window System. It is a good choice for PATH entries that are valid for every user like /usr/local/something/bin. The file is included by other script so use POSIX shell syntax not the syntax of your user shell.

/etc/profile and /etc/profile.d/* Shell script.

This is a good choice for shell-only systems. Those files are read only by shells in login mode.

/etc/<shell>.<shell>rc.

Shell script. This is a poor choice because it is single shell specific. Used in non-login mode.


评论