欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

/etc/profile和/root/.bash_profile有什么区别

程序员文章站 2022-03-21 18:16:09
...

/etc/profile,优先级最高,是全局的,是私有的,用于整个系统所有用户,

~/.bashrc和 ~/.bash_profile, ~/.profile 用于各个用户,这里的"~"符号就是各当前用户的$HOME

~/.bash_profile 和 ~/.profile 只在登陆时读取一次。

~/.bashrc 每次都读取

 

~/.bash_profile 和 ~/.profile 的区别在于

bash 只读取~/.bash_profile;而对于 ~/.profile 来说,不光bash, 其他shell 也读 ~/.profile