环境变量的加载顺序说明 一、可以配置环境变量的几个文件 1. /etc/profile 2. .bashrc 3. /etc/profile.d/*.sh 二、两种会加载环境变量的模式 1. 登录式shell 系统启动时或远程登录时启动的shell 加载配置文件的顺序:/etc/profile.d/*.sh --> /etc/profile 2.非登录式shell 进入系统后,用虚拟终端打开的shell 加载配置文件的顺序:/etc/bashrc --> /etc/profile.d/*.sh --> .bashrc