登陆过程:
1. 读取并执行/etc/profile文件;
2. 读取并执行~/.bash_profile文件;
- 若文件不存在,则读取并执行~/.bash_login文件;
- 若文件不存在,则读取并执行~/.profile文件;
登出过程:
1. 读取并执行~/.bash_logout文件;
2. 读取并执行/etc/bash.bash_logout文件;
/etc/profile The systemwide initialization file, executed for login shells。系统初始化文件,在login shells时执行
/etc/bash.bash_logout The systemwide login shell cleanup file, executed when a login shell exits。系统的登录shell清理文件,当一个登录shell退出时执行。
~/.bash_profile The personal initialization file, executed for login shells。个人初始化文件,为登录shell执行。
~/.bashrc The individual per-interactive-shell startup file。每个交互式shell启动文件。
~/.bash_logout The individual login shell cleanup file, executed when a login shell exits。单个登录shell清理文件,当一个登录shell退出时执行。
原文:https://www.cnblogs.com/wxp100/p/14607320.html