概念

交互式的:这种shell中的命令是由用户输入的(比如从键盘输入),运行的结果显示到终端。例如我们在终端输入的vi xxx、mv /a/a.txt /b等都属于交互式的。

非交互式的:这种shell是读取存放在文件(shell脚本等)中的命令,并且执行它们。通常我们写的shell脚本都是非交互式的,通过 bash 直接运行该脚本文件。

login shell:进入 bash 时需要完整的登陆流程的,就称为 login shell。

non-login shell:取得 bash 接口的方法不需要重复登陆的举动。
比如:我们登陆一个有可视化界面的 Linux 服务器后, 右键启动终端Terminal,此时这个终端接口是不需要输入账号与密码,那么这个启动的shell输入窗口就是non-login shell。
比如:假设现在有root用户和other用户,我们在已经启动的shell终端使用 su other 这样启动的其实也是 non-login shell。而 su - other 则是login shell。

图解

profile与bashrc都用于保存用户的环境信息,而profile用于 交互式login shell,bashrc用于 交互式non-login shell。
全局优先

profile和bashrc的区别

 

 

相关文章:

  • 2021-11-24
  • 2022-01-15
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
猜你喜欢
  • 2021-09-07
  • 2022-03-03
  • 2021-05-04
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-11-15
相关资源
相似解决方案