美文网首页
Linux环境配置

Linux环境配置

作者: fanyank | 来源:发表于2018-08-16 15:31 被阅读3次

Linux文件的执行过程

在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、 ~/.bash_login或 ~/.profile文件中的其中一个,其中检查顺序为
~/.bash_profile ~/.bash_login ~/.profile
如果其中一个文件存在那么就不会执行下面的文件,比如检查到~/.bash_profile文件存在,那么就不会执行~/.bash_login~/.profile
另外,查看~/.bash_profile文件得知~/.bash_profile还会执行~/.bashrc

if [ -f ~/.bashrc ] ; then
   . ./bashrc
fi

还有,查看~/.bashrc文件,得知~/.bashrc文件还会执行/etc/bashrc文件

if [ -f /etc/bashrc ] ; then
   . /etc/bashrc
fi

故最后总结流程如下:


各种文件的执行流程.jpg

相关文章

网友评论

      本文标题:Linux环境配置

      本文链接:https://www.haomeiwen.com/subject/dgqobftx.html