zsy001 发表于 2018-8-19 13:57:22

shell 类型

  站在用户登录的角度来说,shell分为两类:
  登陆式shell:   正常通过某终端登录,su -username(完全登陆)
  非登陆式shell:   su username
  bash 的配置文件:
  全局配置: etc/profile    etc/profile.d/*.sh    etc/bashrc
  个人:    ~/.bash_prefile   ~/.bashrc
  以上五个文件,可以分为两类:
  profile类: 设定环境变量,运行命令或脚本
  bash类: 设定本地变量,定义变量别名
  当bash进程执行时,首先会读取全局的配置即:profile类,然后才会读取个人的配置.

[*]  登录式shell : /etc/profile -> /etc/profile.d/*sh -> ~/.bash_profile -> etc/bashrc -> ~/.bashrc
[*]  非登录式shell: ~/.bashrc ->/etc/bashrc ->etc/profile.d/*sh

页: [1]
查看完整版本: shell 类型