加载bash shell环境变量的顺序
/etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc
系统级别:
/etc/profile
/etc/paths
用户级别:
~/.bash_profile (mac用的)
~/.bash_login
~/.profile
~/.bashrc (这个linux用的)
配置文件
vim ~/.zhsrc
一个环境变量
export 变量名=命令路径
多个变量进行拼接
export PATH=$PATH:ANDROID_SDK
立即生效
source ~/.zhsrc
查看环境变量
echo $PATH