linux bash环境变量加载过程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36793147/article/details/82557434

相关文件

/etc/bashrc
/etc/profile
~/.bashrc
~/.bash_profile

加载时机:

/etc/profile 和 ~/.bash_profile 只在用户登陆时加载
/etc/bashrc 和 ~/.bashrc 则在每次启动bash时都会加载

用户登陆时加载顺序:

1. /etc/profile
2. ~/.bash_profile
3. ~/.bashrc
4. /etc/bashrc

用户登陆后执行bash加载顺序:

1. ~/.bashrc
2. /etc/bashrc

猜你喜欢

转载自blog.csdn.net/qq_36793147/article/details/82557434
今日推荐