CentOS 的 /etc/profile 和 ~/.bash_profile 及 .zshrc

交互式登陆shell

对于交互式的登陆shell而言,CentOS规定了startup文件的加载顺序如下:

登陆过程:
1. 读取并执行/etc/profile文件;
2. 读取并执行~/.bash_profile文件;
- 若文件不存在,则读取并执行~/.bash_login文件;
- 若文件不存在,则读取并执行~/.profile文件;

登出过程:
1. 读取并执行~/.bash_logout文件;
2. 读取并执行/etc/bash.bash_logout文件;

 

.zshrc   source后只会在当前窗口生效

posted @ 2019-04-10 11:30  ma_fighting  阅读(1583)  评论(0编辑  收藏  举报
历史天气查