码迷,mamicode.com
首页 > 系统相关 > 详细

shell 类型

时间:2017-06-26 22:42:01      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:shell   加载顺序   

站在用户登录的角度来说,shell分为两类:

        登陆式shell:     正常通过某终端登录,su -username  (完全登陆)

        非登陆式shell:   su username


bash 的配置文件:

        全局配置: etc/profile    etc/profile.d/*.sh    etc/bashrc

        个人:    ~/.bash_prefile     ~/.bashrc


以上五个文件,可以分为两类:

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

        bash类: 设定本地变量,定义变量别名


当bash进程执行时,首先会读取全局的配置即:profile类,然后才会读取个人的配置.

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

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



shell 类型

标签:shell   加载顺序   

原文地址:http://13023726.blog.51cto.com/13013726/1942050

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!