bash:
全局变量:
/etc/profile, /etc/profile.d/*, /etc/bashrc
个人变量:
~/.bash_profile, ~/.bashrc
bash运行方式:
交互式(登录之后命令行执行命令):
/etc/profile --> /etc/profile.d/* --> ~/.bash_profile --> /etc/bashrc
非交互式:
~/.bashrc --> /etc/bashrc --> /etc/profile.d/*
profile类文件(重启生效或运行命令“source /etc/profile”):
设定环境变量
运行命令或脚本
bashrc类文件:
设定本地变量。
设定命令别名
配置文件生效:
source /etc/profile 或 . /etc/profile