Linux基础(8)关于bash的配置文件
2016-07-13 19:49
621 查看
shell的类型除了图形shell和命令行shell之外,从登陆者的角度又可以划分为登陆式shell以及非登录式shell.
登录式shell: 三种情况
1.正常通过某个终端登陆的shell
2.su - username
3.su -l username
非登录式shell:
1.su username
2.图形终端下打开的命令行窗口
3.自动执行的shell脚本
对于我们最常用的bash的许多特性是由配置文件决定的.bash的配置文件分为两种:全局配置,个人配置
1.全局配置文件
/etc/profile /etc/profile.d/*.sh /etc/bashrc
2.个人配置
~/.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
本文出自 “厚积薄发” 博客,请务必保留此出处http://joedlut.blog.51cto.com/6570198/1826173
登录式shell: 三种情况
1.正常通过某个终端登陆的shell
2.su - username
3.su -l username
非登录式shell:
1.su username
2.图形终端下打开的命令行窗口
3.自动执行的shell脚本
对于我们最常用的bash的许多特性是由配置文件决定的.bash的配置文件分为两种:全局配置,个人配置
1.全局配置文件
/etc/profile /etc/profile.d/*.sh /etc/bashrc
2.个人配置
~/.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
本文出自 “厚积薄发” 博客,请务必保留此出处http://joedlut.blog.51cto.com/6570198/1826173
相关文章推荐
- jenkins结合ansible用shell实现自动化部署和回滚
- Xshell use
- Shell脚本中执行sql语句操作mysql的5种方法
- GitBash+GitLab+Eclipse使用攻略非常详细版
- Content Shell Apk分析之Content模块启动过程(上)
- Powershell批量移除AD组成员
- Exchange2013 Get-MessageTrackingLog Powershell使用
- Windows管理员常用的PowerShell命令
- Lync 2013常用Powershell总结
- Exchange 2010 PowerShell
- Exchange&Lync常用Powershell总结
- linux关于bashrc与profile的区别
- bash 编程杂项
- expect安装和测试
- ADB Shell学习
- 转载:shell中awk printf的用法
- Mysql shell 控制台---mysqlsh
- linux下简单对拍shell脚本
- 如何通过xshell实现Win和linux的交互
- shell的字符串split的小集