bash登录式shell(完全切换)与非登陆式shell(不完全切换)区别
2016-01-14 14:48
267 查看
1、以登录式shell切换用户
登录式shell读取配置文件及其顺序:
2、以非登陆式shell切换用户
非登陆式shell读取配置文件及其顺序:
附:bash配置文件
1、全局配置文件
2、用户个人配置文件
其中:
profile类配置:设置环境变量,执行登陆后自动运行的命令或脚本
bashrc类配置:设定本地变量,设定别名
su - username
登录式shell读取配置文件及其顺序:
/etc/profile /etc/profile.d/*.sh ~/.bash_profile ~/.bashrc /etc/bashrc
2、以非登陆式shell切换用户
su username
非登陆式shell读取配置文件及其顺序:
~/.bashrc /etc/bashrc /etc/profile.d/*.sh
附:bash配置文件
1、全局配置文件
/etc/profile /etc/profile.d/*.sh /etc/bashrc
2、用户个人配置文件
~/.bash_profile ~/.bashrc
其中:
profile类配置:设置环境变量,执行登陆后自动运行的命令或脚本
bashrc类配置:设定本地变量,设定别名
相关文章推荐
- Google Style Guides-Shell Style Guide
- shell 不同颜色打印
- 利用shell脚本来监控linux系统的内存
- Unix
- 利用shell脚本来监控linux系统的负载与CPU占用情况
- 使用Shell脚本对Linux系统和进程资源进行监控
- Java 希尔排序(Shell Sort)
- linux下性能监控shell脚本实现系列一(服务器整体性能监控)
- shell脚本连接、读写、操作mysql数据库实例
- 【问题解决】syntax error: unexpected end of file或-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No
- Bash shell编程<七>:处理选项、getopt命令
- Linux 开机启动[root@localhost]变成bash-3.2#解决方法
- shell脚本编程之补充知识点
- shell脚本编程之数组
- #!/bin/bash
- Shell脚本编程之判断语句
- Linux SHELL 命令入门题目答案(一)
- Linux SHELL 命令入门题目(一)
- Hadoop Shell命令字典
- 开始Shell编程