【笔记】MacOS环境变量优先级

前言

MacOS环境变量PATH优先级

查看环境变量PATH

1
echo $PATH

Mojave 10.14 及以下配置文件加载顺序

  • /etc/profile/->/etc/paths->/etc/bashrc->~/.bash_profile->~/.bashrc

Shell历史

  • ~/.bash_history

Catalina 10.15 及以上配置文件加载顺序

  • /etc/profile/->/etc/paths->/etc/zshrc->/etc/zshrc->~/.zsh_profile

Shell历史

  • ~/.zsh_history

完成

参考文献

CSDN——Action_Wang
简书——TangFly