cag2050

linux 知识点

  • 关于登录Linux时,/etc/profile、~/.bash_profile等几个文件的执行过程。
    在登录Linux时要执行文件的过程如下:
    在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、 ~/.bash_login或 /.profile文件中的其中一个,执行的顺序为:/.bash_profile、 ~/.bash_login、 ~/.profile。如果 ~/.bash_profile文件存在的话,一般还会执行 ~/.bashrc文件。
    因为在 ~/.bash_profile文件中一般会有下面的代码:
if [ -f ~/.bashrc ] ; then
. ./bashrc
fi

~/.bashrc中,一般还会有以下代码:

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

所以,~/.bashrc会调用 /etc/bashrc文件。最后,在退出shell时,还会执行 ~/.bash_logout文件。
执行顺序为:/etc/profile -> (~/.bash_profile | ~/.bash_login | ~/.profile) -> ~/.bashrc -> /etc/bashrc -> ~/.bash_logout

  • 查找目录:find /(查找范围) -name \'查找关键字\' -type d
    查找文件:find /(查找范围) -name 查找关键字 -print

分类:

技术点:

相关文章:

  • 2021-08-01
  • 2021-04-26
  • 2021-11-12
  • 2021-10-29
  • 2021-12-05
  • 2021-12-05
猜你喜欢
  • 2022-02-07
  • 2022-02-07
  • 2022-12-23
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-09-08
相关资源
相似解决方案