linux_用户角度的shell配置文件

站在用户角度来看shell的类型:
  登陆式shell:
       正常通过某终端登陆
       su - username
       su -l username
 
  非登陆式shell:
       su username
       图形终端下打开命令窗口
       自动执行的shell脚本


用户登录时,对用户环境产生影响的bash配置文件:
    全局配置: /etc/profile,/etc/bashrc,/etc/profile.d/*.sh
    个人配置: ~/.bash_profile,~/.bashrc

    profile类文件:
       设定环境变量
       运行命令或脚本

    bashrc类文件:
       设定本地变量
       定义命令别名


    登陆式shell读取配置文件过程
       /etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc -->/etc/bashrc

    非登陆式shell读取配置文件过程
       /.bashrc --> /etc/bashrc --> /etc/profile.d/*.sh

posted @ 2016-01-04 20:51  Mr.hale  阅读(204)  评论(0编辑  收藏  举报