Linux中bashrc河bash_profile

/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置.

/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取.

~/.bash_profile 调用 ~/.bashrc

每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该
文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.

~/.bashrc调用/etc/bashrc

该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该

该文件被读取. 

就是linux登陆时,会加载/etc/profile,也会加载~/.bash_profile。

然后根据语句,~/.bash_profile会调用~/.bashrc, ~/.bashrc会调用/etc/bashrc

扫描二维码关注公众号,回复: 771989 查看本文章

猜你喜欢

转载自jdoc.iteye.com/blog/1771436