首页 > 其他 > 详细

随手笔记NO.4

时间:2018-02-22 19:05:49      阅读:201      评论:0      收藏:0      [点我收藏+]
shell的分类

登录式shell:

正常通常某终端登录
su - USERNAME 
su -l USERNAME

非登录式shell:

su USERNAME
图形终端下打开命令窗口
自动执行的shell脚本

他们之间的区别

在说之前首先看我们的bash的配置文件:
全局配置
    /etc/profile, /etc/profile.d/*.sh, /etc/bashrc
个人配置
    ~/.bash_profile, ~/.bashrc

profile类的文件:
    设定环境变量
    运行命令或脚本
bashrc类的文件:
    设定本地变量
    定义命令别名

这就是区别(读取的文件和顺序都不同)

    登录式shell如何读取配置文件?
    /etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
    非登录式shell如何读取配置文件?
    ~/.bashrc --> /etc/basrc --> /etc/profile.d/*.sh

随手笔记NO.4

原文:http://blog.51cto.com/13132323/2072201

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