【Linux】profile与bashrc

1、单个用户的启动配置文件

~/.profile
~/.bashrc

2、全部用户的启动配置文件

/etc/profile
/etc/bash.bashrc
  1. bashrc是在系统启动后就会自动运行。
  2. profile是在用户登录后才会运行。
  3. 进行设置后,可运用source bashrc命令更新bashrc,也可运用source profile命令更新profile。
    PS:通常我们修改bashrc,有些linux的发行版本不一定有profile这个文件,本文用的系统是Ubuntu 15.10
  4. /etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系。
posted @ 2024-08-02 08:06  NotReferenced  阅读(3)  评论(0编辑  收藏  举报