【.bash_profile 与 .bashrc 的区别】
来源:互联网 发布:photoshopcs6 mac破解 编辑:程序博客网 时间:2024/06/05 16:53
【.bash_profile 与 .bashrc 的区别】
.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
【login shell 与 non-login shell 的区别】
1、当你直接在机器login界面登陆、使用ssh登陆或者su切换用户登陆时,.bash_profile 会被调用来初始化shell环境
Note:.bash_profile文件默认调用.bashrc文件
.bash_profile中有如下内容
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
2、当你不登陆系统而使用ssh直接在远端执行命令,.bashrc 会被调用
3、当你已经登陆系统后,每打开一个新的Terminal时,.bashrc 都会被再次调用。
【故】若要配置环境变量之类,最保险是写在 .bashrc 文件中。因为不管是登陆还是不登陆,该文件总会被调用!
~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该
文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
并从/etc/profile.d目录的配置文件中搜集shell的设置.
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.
0 0
- 【.bash_profile 与 .bashrc 的区别】
- .bash_profile 与 .bashrc 的区别
- .bash_profile与.bashrc作用的区别
- .bash_profile和.bashrc的区别
- bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bashrc和.bash_profile的区别
- .bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- bash_profile和.bashrc的区别
- .bash_profile和.bashrc的区别
- .bash_profile 和 .bashrc的区别
- 事物的四大特性、锁
- 提高Java技能,如何优化代码
- hbase shell&java 获取多版本的值
- 字符编码基础知识
- 手把手教你把Vim改装成一个IDE编程环境(图文)
- 【.bash_profile 与 .bashrc 的区别】
- Linux find 命令
- C#输出早中晚,教科书的第一个程序
- springmvc+mongodb+maven 项目搭建配置
- 蛇和梯子(bfs)
- iPhone开发之NSRunLoop的进一步理解
- OHCI、UHCI、EHCI
- hdu-1312 Red and Black
- 动态规划——最长回文子序列