/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc
/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc很容易混淆,他们之间有什么区别?它们的作用到底是什么?
/etc/profile: 用来设置系统环境参数,比如$PATH. 这里面的环境变量是对系统内所有用户生效的。
/etc/bashrc: 这个文件设置系统bash shell相关的东西,对系统内所有用户生效。只要用户运行bash命令,那么这里面的东西就在起作用。
~/.bash_profile: 用来设置一些环境变量,功能和/etc/profile 类似,但是这个是针对用户来设定的,也就是说,你在/home/user1/.bash_profile 中设定了环境变量,那么这个环境变量只针对 user1 这个用户生效.
~/.bashrc: 作用类似于/etc/bashrc, 只是针对用户自己而言,不对其他用户生效。
另外/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.
~/.bash_profile 是交互式、login 方式进入 bash 运行的,意思是只有用户登录时才会生效。
~/.bashrc 是交互式 non-login 方式进入 bash 运行的,用户不一定登录,只要以该用户身份运行命令行就会读取该文件。
/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc的更多相关文章
- /etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 的区别(转)
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个运 ...
- 浅析Linux下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc文件
转自:http://www.ahlinux.com/shell/20239.html 0x01 /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行,并从/e ...
- Linux 启动时profile、bashrc、~/.bash_profile、~/.bashrc、~/.bash_profile执行顺序以及文件说明
Linux 启动时profile.bashrc.~/.bash_profile.~/.bashrc.~/.bash_profile执行顺序以及文件说明 一.执行顺序 登录linux时,/etc/pro ...
- /etc/profile、~/.bash_profile、~/.bashrc和/etc/bashrc
文件 引用关系 执行时间 影响用户 使用场景 /etc/profile 开机执行 所有用户 所有用户.重启生效 ~/.bash_profile 引用~/.bashrc 用户登录时执行 当前用户 当 ...
- /etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件的作用
转载自:http://blog.csdn.net/u013968345/article/details/21262033 /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登 ...
- linux命令(24):/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc
/etc/profile./etc/bashrc.~/.bash_profile.~/.bashrc很容易混淆,他们之间有什么区别?它们的作用到底是什么? /etc/profile: 用来设置系统环境 ...
- inux 下的/etc/profile、/etc/bashrc、~/.bash_profile、~/.bashrc 文件的作用
/etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. ~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的sh ...
- linux下/etc/profile、/etc/bashrc、~/.bashrc 和~/.bash_profile文件的区别
这个一定要理解登录式shell和非登录式shell的区别,前者是完全切换用户,后者是不完全,就算切换过来了,你pwd时家目录还是之前的家目录,所以 登录式顺序为:/etc/bashrc---/etc/ ...
- Linux之profile、bash_profile、bashrc文件
来自: profile.bash_profile.bashrc文件的作用与区别 1. profile 文件 1.1 profile 文件的作用 profile(/etc/profile),用于设置系统 ...
随机推荐
- 调试python程序
pdb 关键步骤 python -m pdb ***.py n 单步
- mongodb C# 驱动查询
INoSqlProvider provider = NoSqlManager.Create("CloudTable"); IMongoCollection<FormMongo ...
- AIX上通过IPSEC进行IP包过滤
AIX上的IPSEC 在AIX可以通过以下步骤打开IP Security smitty ipsec4 --> Start/Stop IP Security --> Start IP Sec ...
- Eclipse下maven使用嵌入式(Embedded)Neo4j创建Hello World项目
Eclipse下maven使用嵌入式(Embedded)Neo4j创建Hello World项目 新建一个maven工程,这里不赘述如何新建maven工程. 添加Neo4j jar到你的工程 有两种方 ...
- 新浪微博AppKey大集合(share)
本文转自:http://blog.sina.com.cn/s/blog_9e1ea13a01017y3n.html ------------------------------------------ ...
- 【转】DBMS_STATS.GATHER_TABLE_STATS详解
转自http://blog.itpub.net/26892340/viewspace-721935/ [作用] DBMS_STATS.GATHER_TABLE_STATS统计表,列,索引的统计信息(默 ...
- Angularjs directive
.directive('mydir',function(){ return{ multiElement: true/false, priority: number, //default: 0 term ...
- SSH(Struts,Spring,Hibernate)和SSM(SpringMVC,Spring,MyBatis)之间区别
http://m.blog.csdn.net/article/details?id=52795914#0-qzone-1-52202-d020d2d2a4e8d1a374a433f596ad1440
- cloudera manager安装spark后使用spark shell编写基于scala的world count
val file = sc.textFile("hdfs://zhcloudil-lcnode04:8020/user/cloudil/wc_spark.txt") val cou ...
- vs安装失败,发生严重错误,错误号:Error 0x80070643
发生这个的原因很大的可能是vs安装的目录不是系统默认目录,改一下就好了. C:\Program File(x86) 不要看网上那些没有的,都TM骗人的. 不要问我是怎么知道的,你只要知道我的电脑让我重 ...