(Zsh) macOS系统环境变量文件

基于zsh配置环境变量
  • .zshenv
通常位于 /etc/zshenv(全局系统配置)和 ~/.zshenv(特定用户配置)
始终被所有类型 shell 最先加载。(无论是登录 shell、交互式非登录 shell,还是非登录的、非交互式的 shell)
  • .zprofile
通常位于 /etc/zprofile(全局系统配置)和 ~/.zprofile(特定用户配置)
只被登录 shell 加载,在 zshenv 之后,但在 zshrc 之前。
  • .zshrc
通常位于 /etc/zshrc(全局系统配置)和 ~/.zshrc(特定用户配置)
被所有的交互式 shell 加载(包括登录 shell 和非登录 shell),在 zshenv 和 zprofile 之后。
  • .zlogin
通常位于 /etc/zlogin(全局系统配置)和 ~/.zlogin(特定用户配置)
只被登录 shell 加载,在 zshenv、zprofile 和 zshrc 之后。
  • .zlogout
通常位于 /etc/zlogout(全局系统配置)和 ~/.zlogout(特定用户配置)
只被登录 shell 在退出时加载,在所有其他配置文件之后。
  • order
'zshenv'  -> 'zprofile' -> 'zshrc' -> 'zlogin' -> 'zlogout'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容