00001 - Linux下 环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别
①/etc/profile:
该文件登录操作系统时,为每个用户设置环境信息,当用户第一次登录时,该文件被执行。也就是说这个文件对每个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.1
②/etc/bashrc:
为每一个运行bash shell的用户执行此文件,当bash shell被打开时,该文件被读取。也就是说,当用户shell执行了bash时,运行这个文件。
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# 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.
③~/.bashrc
该文件存储的是专属于个人bash shell的信息,当登录时以及每次打开一个新的shell时,执行这个文件。在这个文件里可以自定义用户专属的个人信息。
那么在用户登录系统时候,相关的文件执行顺序是什么呢。
在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、
~/.bash_login或 ~/.profile文件中的其中一个,执行的顺序为:~/.bash_profile、 ~/.bash_login、
~/.profile。如果 ~/.bash_profile文件存在的话,一般还会执行 ~/.bashrc文件。
00001 - Linux下 环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别的更多相关文章
- 【Linux】Linux下 环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别【转】
转自:http://blog.csdn.net/qiao1245/article/details/44650929 ------------------------------------------ ...
- Linux下环境变量设置技巧
Linux下环境变量设置技巧,不用/etc/profile而是在/etc/profile.d目录下新建特定的shell文件来设置 区别: 1.两个文件都是设置环境变量文件的,/etc/profile是 ...
- Linux下环境变量设置 (转)
Linux下环境变量设置 1.在Windows 系统下,很多软件安装都需要配置环境变量,比如 安装 jdk ,如果不配置环境变量,在非软件安装的目录下运行javac 命令,将会报告找不到文件,类似的错 ...
- Linux下环境变量设置技巧,不用/etc/profile而是在/etc/profile.d目录下新建特定的shell文件来设置
区别: 1.两个文件都是设置环境变量文件的,/etc/profile是永久性的环境变量,是全局变量,/etc/profile.d/设置所有用户生效,同样是永久变量,是全局变量. 2./etc/prof ...
- Linux下环境变量设置
分类 Linux下的环境变量按生存周期来划分,可以划分为两种: 1)永久的:需要修改配置文件, 变量永久生效 2)临时的:直接在终端使用export命令声明即可,但是关闭shell后失效. 设置方法 ...
- Linux下环境变量配置方法梳理(.bash_profile和.bashrc的区别)
在linux系统下,如果下载并安装了应用程序,在启动时很有可能在键入它的名称时出现"command not found"的提示内容.如果每次都到安装目标文件夹内,找到可执行文件来进 ...
- Linux下环境变量(.bash_profile和.bashrc的区别)
在linux系统下,如果下载并安装了应用程序,在启动时很有可能在键入它的名称时出现"command not found"的提示内容.如果每次都到安装目标文件夹内,找到可执行文件来进 ...
- linux 下环境变量设置
Ubuntu Linux系统包含两类环境变量:系统环境变量和用户环境变量.系统环境变量对所有系统用户都有效,用户环境变量仅仅对当前的用户有效. 修改用户环境变量 用户环境变量通常被存储在下面的文件中: ...
- Linux 系统中环境变量/etc/profile、/etc/bashrc、~/.bashrc的区别
/etc/profile./etc/bashrc.~/.bashrc的区别 1> etc目录下存放系统管理和配置文件 (系统配置) etc/profile: profile为所有的用户 ...
随机推荐
- diskcache
DiskCache: Disk Backed Cache DiskCache is an Apache2 licensed disk and file backed cache library, wr ...
- centos7配置openldap服务器
参考链接 https://www.cnblogs.com/bigbrotherer/p/7251372.html 上面这篇参考文件在最后登录是有问题的 vi /etc/openldap/sldap.c ...
- 02c语言指针基础
& 用来取一个变量的地址 * 用来取一个地址的值 例如: (1)&n 获取n的地址 int *p=&n; *p就等于p的值 (2) 假设 int n=10; *(&n) ...
- Unity 游戏性能优化 学习
优化误区
- mysql中 where in 用法详解
这里分两种情况来介绍 1.in 后面是记录集,如: select * from table where uname in(select uname from user); 2.in ...
- Zabbix-2.4-安装-3
zabbix自动注册简单介绍---创建自动注册的actions 怎么把1000台机器加zabbix里 zabbix提供了网络发现和自动注册2个功能,发现有机器连过来,给它加个模板 如果是win ...
- 用react编写一个hello world
我要分享的是用react搭建一个简单的hello world, 一个小demo, 大神请略过 首先看一下目录结构 创建一个目录, 用于存放demo mkdir reactHello cd reactH ...
- redux 知识点
redux原理:store中维护了一个state,我们dispatch一个action,接下来reducer根据这个action更新state. react-redux提供两个关键模块:Provide ...
- Vivado使用技巧(1)
Vivado使用技巧 (1) 1. 2.复位准则: 3. 4. 5. 6. 7. 8.
- PHP性能监测的工具介绍 - XHProf -参考自https://jingyan.baidu.com/article/7082dc1c173359e40a89bd95.html
XHProf 这个软件本是Facebook内部的一个应用工具,2009年3月份开源,为PHP的性能监测提供了很好的工具.官方的介绍中提到: 方法/步骤 XHProf 这个软件本是Faceboo ...