linux /etc/profile bashrc bash_profile

文件: /etc/profile  ~/.bashrc  和  ~/.bash_profile 的使用区别:

/etc/profile: 全局 环境变量等,在机器重启后执行一次, 用于设置环境变量,更改一些内核参数等命令。

/etc/bashrc : 全局登陆  变量,如 alias.

bashrc  和 bash_profile : 登陆执行的动作,主要用于设置 别名等 小动作。

bash_profile 是每次登陆都会执行,执行过程中调用 bashrc ,bashrc 不是每次登陆都会执行。

alias and unalias , alias 多写在 .bashrc, .bash_profilc 里,每次登陆生效,区别是正对全部用户设置还是 单独用户。 

alias ,cd ,pwd  称为 内部变量, 无配置文件,用enable 查询。

猜你喜欢

转载自www.cnblogs.com/brucewhite/p/11608681.html