Linux系统中profile、bshrc、bash_profile、profile.d文件的区分
2017-02-07 14:59
295 查看
profile类:
全局:对所有用户都生效
/etc/profile
/etc/profile.d/*.sh
用户个人:仅仅对当前用户有效
~/.bash_profile
作用:
1、用于定义环境变量
2、运行命令或脚本
bashrc类:
全局:
/etc/bashrc
用户个人:
~/.bashrc
作用:
1、定义本地变量
2、定义命令别名
注意:仅管理员可修改全局配置文件
交互式登陆shell进程:
/etc/profile------>/etc/profile.d/* ----->~/.bash_profile --->~/.bashrc ---->/etc/bashrc
非交互式shell登陆进程:
~/.bashrc--->/etc/bashrc ---->/etc/profile.d/*
命令行中定义的特性,例如变量和别名作用域仅仅对当前shell的生命周期
配置文件定义的特性,只对随后新启动的shell进程有效
让通过配置文件定义的特性立即生效方法:
(1)通过命令行重复定义一次;
(2)让shell进程重读配置文件;
source /path/config_file
./path/config_file
全局:对所有用户都生效
/etc/profile
/etc/profile.d/*.sh
用户个人:仅仅对当前用户有效
~/.bash_profile
作用:
1、用于定义环境变量
2、运行命令或脚本
bashrc类:
全局:
/etc/bashrc
用户个人:
~/.bashrc
作用:
1、定义本地变量
2、定义命令别名
注意:仅管理员可修改全局配置文件
交互式登陆shell进程:
/etc/profile------>/etc/profile.d/* ----->~/.bash_profile --->~/.bashrc ---->/etc/bashrc
非交互式shell登陆进程:
~/.bashrc--->/etc/bashrc ---->/etc/profile.d/*
命令行中定义的特性,例如变量和别名作用域仅仅对当前shell的生命周期
配置文件定义的特性,只对随后新启动的shell进程有效
让通过配置文件定义的特性立即生效方法:
(1)通过命令行重复定义一次;
(2)让shell进程重读配置文件;
source /path/config_file
./path/config_file
相关文章推荐
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程
- 登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- 如何在你的MACOS,创建.bash_profile(隐藏文件)
- 配置文件.profile,.login,.bash_profile和.bashrc的区别
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程。
- Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程
- 几个profile, bashrc, bash_profile等文件
- .bash_profile .bashrc profile 文件的作用的执行顺序
- 登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- /etc/profile、~/.bash_profile等几个文件的执行过程
- 登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程
- shell的初始化文件:/etc/profile和/etc /bashrc(bash.bashrc)
- 初识Linux .bash_profile, .bash_logout, and .bashrc 文件
- 登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- 浅析linux 下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件
- [转]登录Linux时/etc/profile、~/.bash_profile等几个文件的执行过程
- 关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程。
- Linux 之 /etc/profile、~/.bash_profile 等几个文件的执行过程