https://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/

linux系统里有各种启动加载文件:
.bashrc.bash_profile.bash_login.profile 等,事实上,这里的文件并不是都会被用到,这取决于是以何种方式进入系统

对bash,读取顺序如下表所示,先执行A,然后B,然后C , B1,B2,B3的意思是,按顺序读取最先读到的一个。

Interactive login Interactive non-login Script
/etc/profile A
/etc/bash.bashrc A
~/.bashrc B
~/.bash_profile B1
~/.bash_login B2
~/.profile B3
BASH_ENV A
~/.bash_logout C

从tty登录和通过ssh远程登录,就是 login shell

docker exec -it container bash 方式进入容器的,输入 non-login 的 shell

相关文章:

  • 2022-01-17
  • 2021-08-14
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2021-11-12
  • 2021-10-06
  • 2021-05-31
相关资源
相似解决方案