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

linux命令——bash shell 配置

时间:2014-12-09 23:09:57      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:bash   shell   

一、shell的类型

站在用户登录的角度来说,shell的类型有:

1、登录式shell: (读取环境配置)

正常通过某终端登录:

 su - USERNAME

 su -l USERNAME


2、非登录式shell:(不读取环境配置)

su USERNAME

图形终端下打开的命令窗口

自动执行的shell脚本


2、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/bashrc --> /etc/profile.d/*.sh



linux命令——bash shell 配置

标签:bash   shell   

原文地址:http://blog.csdn.net/wuseyukui/article/details/41832303

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