bash的配置文件定义

bash的配置文件:


按生效范围划分,存在两类:
全局配置:
/etc/profile
/etc/profile.d/*.sh
/etc/bashrc
个人配置:
~/.bash_profile
~/.bashrc


按功能划分,存在两类:
profile类:为交互式登录的shell提供配置
全局:/etc/profile, /etc/profile.d/*.sh
个人:~/.bash_profile
功用:
(1) 用于定义环境变量;
(2) 运行命令或脚本;


bashrc类:为非交互式登录的shell提供配置
全局:/etc/bashrc
个人:~/.bashrc


功用:
(1) 定义命令别名;
(2) 定义本地变量;


shell登录:
交互式登录:
直接通过终端输入账号密码登录;
使用“su - UserName”或“su -l UserName”切换的用户


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


非交互式登录:
su UserName
图形界面下打开的终端
执行脚本


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


编辑配置文件定义的新配置的生效方式:
(1) 重新启动shell进程;
(2) 使用source或.命令进程;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值