shell的类型除了图形shell和命令行shell之外,从登陆者的角度又可以划分为登陆式shell以及非登录式shell.

  登录式shell:  三种情况

  1.正常通过某个终端登陆的shell

  2.su - username

  3.su -l username 

  非登录式shell:

  1.su username 

  2.图形终端下打开的命令行窗口

  3.自动执行的shell脚本

  

  对于我们最常用的bash的许多特性是由配置文件决定的.bash的配置文件分为两种:全局配置,个人配置 

  1.全局配置文件

  /etc/profile  /etc/profile.d/*.sh  /etc/bashrc

  2.个人配置

  ~/.bash_profile ~/.bashrc

   对于profile类的文件的作用(设定环境变量 运行命令或者脚本)

   Linux基础(8)关于bash的配置文件_Linux

   对于bashrc类的文件(设定本地变量 定义命令别名)

   Linux基础(8)关于bash的配置文件_配置文件_02

   对于登陆式shell读取配置文件的顺序。

   /etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc

   对于非登陆shell读取配置文件的顺序。

   ~/.bashrc --> /etc/bashrc --> /etc/profile.d/*.sh