Liunx中环境变量的配置profile,environment,barshrc
来源:互联网 发布:linux dhcp 编辑:程序博客网 时间:2024/05/22 16:45
在Linux下通常我们配置环境变量可以通过一下方法:
export命令直接在shell下设置 :缺点,只对当前shell生效
~/bashrc :包含单个用户的bash shell的bash环境信息,当登录时以及每次打开新的shell时,该该文件被读取。
/etc/bashrc :为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取。~/bashrc与/etc/bashrc的区别在于前者对于单个用户而言,后者对于所有的用户是设置整个系统的环境,而/etc/profile是设置所有用户的环境。(局限性:只限制为bash shell提供环境设置)
/etc/profile :此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置。所有用户的shell都有权使用这些环境变量(特点:不限至shell的种类)。
~/profile :可以把使用这些环境变量的权限控制到用户级别,如果你需要给某个用户权限使用这些环境变量,只需要修改其个人用户主目录下的.bashrc文件就可以了。进行设置后,可运用source profile命令更新profile。(source命令详见:http://blog.csdn.net/lyhdream/article/details/8873297)
/etc/environment :是设置整个系统的环境,优先权最高,而/etc/profile是设置所有用户的环境变量并且不区分shell类型;而而/etc/bashrc是设置所有用户的环境变量,只针对bash shell。
参考地址:http://developer.51cto.com/art/200906/129515.htm
http://www.linuxeden.com/html/sysadmin/20080424/56879.html
http://andy136566.iteye.com/blog/1025338
- Liunx中环境变量的配置profile,environment,barshrc
- linux中环境变量配置bashrc与profile的区别
- 详细:Liunx中配置java环境变量以及tomcat环境变量
- liunx下配置环境变量
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu profile-environment-bashrc 添加环境变量
- ubuntu下环境变量详解 profile environment
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu下环境变量详解 bashrc, profile, environment
- ubuntu下环境变量详解 bashrc, profile, environment
- linux中/etc/profile 与/etc/environment文件的区别?
- linux中/etc/profile 与/etc/environment文件的区别?
- linux中/etc/profile 与/etc/environment文件的区别
- /etc/profile,/etc/environment,.bash_profile及.bashrc等与环境变量有关的文件的比较
- Linux 中/etc/profile、~/.bash_profile 环境变量配置及执行过程
- petshop4中profile的配置
- petshop4中profile的配置
- /etc/profile环境变量配置解析
- 格林威治标准时间和协调世界时
- 规划成就人生
- JFreeChart简单小例子
- Microsoft Visual Studio (c#)连接到数据库---Userlogin窗口--向先先
- c#基础-继承,派生类,派生类的构造 方法
- Liunx中环境变量的配置profile,environment,barshrc
- 苹果MAC操作系统上搭建Android开发平台环境
- JSP/Servlet,Tomcat,Jstl各版本对比以及如何查看版本
- shell成绩管理系统
- 地图基础知识
- 清除浮动大总结
- SAP HANA 10. Create an SQLScript Procedure with Imperative Logic
- 今天用GridView报错,找了好久才发现问题所在
- 20131129秒针系统算法面试