小编sta*_*low的帖子

.bash_profile 和 .bash_login 有什么区别?

我一直在研究 bash 的工作原理,到目前为止我已经了解了以下内容:

启动登录 shell 时,将执行以下存在的第一个文件:

~/.bash_profile, ~/.bash_login,~/.profile

当启动交互式的非登录 shell(或子 shell)时,该~/.bashrc文件将被执行。

此外,.profile 还可以由 sh 等其他 shell 执行。我现在的问题是,拥有 .bash_profile 和 .bash_login 有什么意义?它们都执行相同的功能,并且与 .profile 不同,.bash_profile 和 .bash_login 都只能由 bash 读取。我知道它们之间的唯一区别是,如果 .bash_profile 不存在,则 .bash_login 会被执行。那么为什么它会在那里呢?

bash

11
推荐指数
2
解决办法
4120
查看次数

标签 统计

bash ×1