linux下bash配置文件詳解
2016-04-11 14:36
525 查看
linux下bash配置文件1.bash的配置文件:
全局配置:/etc/profile, /etc/profile.d/*.sh, /etc/bashrc
个人配置:~/.bash_profile, ~/.bashrc
profile类的文件:
设定环境变量
运行命令或脚本
bashrc类的文件:
设定本地变量
定义命令别名
2. 登录式shell读取配置文件順序如下:
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
非登录式shell讀取配置文件順序如下:
~/.bashrc --> /etc/basrc --> /etc/profile.d/*.sh
3.登录式shell通常有以下:
正常通過终端登录 su - 用戶名 su -l 用戶名 非登录式shell通常有以下:
su 用戶名 (只切換了部分) 图形终端下打开terminal窗口 自动执行的shell脚本
本文出自 “夏维柳” 博客,请务必保留此出处http://willow.blog.51cto.com/6574604/1762610
全局配置:/etc/profile, /etc/profile.d/*.sh, /etc/bashrc
个人配置:~/.bash_profile, ~/.bashrc
profile类的文件:
设定环境变量
运行命令或脚本
bashrc类的文件:
设定本地变量
定义命令别名
2. 登录式shell读取配置文件順序如下:
/etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
非登录式shell讀取配置文件順序如下:
~/.bashrc --> /etc/basrc --> /etc/profile.d/*.sh
3.登录式shell通常有以下:
正常通過终端登录 su - 用戶名 su -l 用戶名 非登录式shell通常有以下:
su 用戶名 (只切換了部分) 图形终端下打开terminal窗口 自动执行的shell脚本
本文出自 “夏维柳” 博客,请务必保留此出处http://willow.blog.51cto.com/6574604/1762610
相关文章推荐
- xshell展示服务器记录日志
- bash之 history
- shell变量赋值 不能有空格的原因
- linux shell中,单引号、 双引号,反引号(``),$()的区别
- 【Web】前台传送JSON格式数据到后台Shell处理
- bash shell命令行选项与修传入参数处理
- xshell复制粘贴
- 在Xshell中使用vim乱码解决方法
- MySQL问题解决:-bash:mysql:command not found
- shell下一层输入yes
- shell具体执行过程及自主实现shell解释器
- xargs的使用
- 在shell脚本中调用另一个脚本的三种不同方法(fork, exec, source)
- shell远程执行命令
- 小黑的日常折腾-快速建立私有CA的shell脚本 推荐
- 树莓派——查看CPU温度
- 子shell
- Javascript Shell入门分享
- bash有意思的记录
- shell编程