Ubuntu下profile,bashrc
2017-07-20 10:08
218 查看
系统级环境变量设置
/etc/profile
这个对所有用户有效,当用户第一次登录时,该文件被执行.并从/etc/profile.d目录的配置文件中搜集shell的设置.英文描述为: # /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases Go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates.
/etc/environment
这个文件里面就一个PATH环境变量,它的执行顺序是晚于/etc/profile用户级环境变量配置
~/.profile
这个文件类似于/etc/profile,只是它是针对用户级的,每一个用户都会有一个自己的.profile,这个文件会调用~/.bashrc(如果存在的话)~/.bashrc
当登录时以及每次打开新的shell时,该文件被读取.(每个用户都有一个.bashrc文件,在用户目录下)。当修改了.bashrc的内容,不需要重启生效,只要重新打开一个bash即可生效临时环境变量配置
export命令export PATH=HOME/bin:PATH
其他配置文件
~/.bash_logout
每次退出系统时执行系统级与用户级执行顺序
/etc/profile–>/etc/environment–>$HOME/.profile相关文章推荐
- Ubuntu-关于bashrc与profile的区别
- ubuntu下环境变量详解 bashrc, profile, environment
- Ubuntu-11.10之八 profile与bashrc的分析
- .bash_profile和.bashrc的区别,ubuntu下为.profile,没有.bash_profile
- Ubuntu不同目录下profile与bashrc的区别
- Ubuntu不同目录下profile与bashrc的区别
- Mac和Ubuntu系统下.bash_profile和.bashrc文件
- ubuntu profile-environment-bashrc 添加环境变量
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu profile-environment-bashrc 添加环境变量
- Ubuntu不同目录下profile与bashrc的区别
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu profile environment bashrc
- Ubuntu不同目录下profile与bashrc的区别
- ubuntu profile environment bashrc
- Ubuntu在/etc/profile中配置好了Java环境,运行Java子命令无效问题(~/.bashrc等文件分析)
- Ubuntu下的/etc/profile,/etc/environment,/etc/bashrc和~/.bashrc
- Ubuntu不同目录下profile与bashrc的区别
- ubuntu 系统 /etc/profile, ~/.profile, ~/.bashrc, ~/.bash_logout,~/.bash_history 文件的内容及解析