首页 > 其他 > 详细

bash的配置文件类型

时间:2016-03-03 19:39:46      阅读:247      评论:0      收藏:0      [点我收藏+]

profile类:为交互式登录的shell进程提供配置

    bashrc类:为非交互式登录的shell进程提供配置



全局:对所有用户都生效
用户个人:仅对当前用户有效
功用
profile类

/etc/profile 或 /etc/profile.d/*.sh

~/.bash_profile

1、定义环境变量;

2、运行命令或脚本

bashrc类
/etc/bashrc
 ~/.bashrc

1、定义本地变量;

2、定义命令别名;

     登录类型:

        交互式登录shell进程:

    直接通过某终端输入账号和密码后登录打开的shell进程;

    使用su命令:su - USERNAME, 或者使用 su -l USERNAME执行的登录切换;

        非交互式登录shell进程:

    su USERNAME执行的登录切换;

    图形界面下打开的终端;

    运行脚本


     配置文件读取顺序:

     交互式登录shell进程:

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


     非交互式登录shell进程:

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


bash的配置文件类型

原文:http://nginxx.blog.51cto.com/1509727/1747237

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