首页 > 系统服务 > 详细

linux_用户角度的shell配置文件

时间:2016-01-04 21:05:25      阅读:242      评论:0      收藏:0      [点我收藏+]

站在用户角度来看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

linux_用户角度的shell配置文件

原文:http://www.cnblogs.com/Xhale/p/5100201.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!