/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/profile有修改的话必须得重启你的修改才会生效,此修改对每个用户都生效。

/etc/bashrc:为每一个运行bash shell的用户执行此文件。当bash shell被打开时,该文件被读取。

英文描述:

# /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.

如果你想对所有的使用bash的用户修改某个配置并在以后打开的bash都生效的话,可以修改这个文件,修改这个文件不用重启,重新打开一个bash即可生效。

~//bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登陆时,该文件仅仅执行一次!默认情况下,它设置一些环境变量,执行用户的.bashrc文件。

此文件类似于/etc/profile,也是需要重启才会生效,/etc/profile对所有用户生效,~/.bash_profile只对当前用户生效

~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登陆时以及每次打开新的shell时,该文件被读取。(每个用户都有一个.bashrc文件,在用户目录下)

~/.bashrc文件类似于/etc/bashrc,不需要重启生效,重新打开一个bash即可生效,/etc/bashrc对所有用户新打开的bash都生效,但~/.bashrc只对当前用户新打开的bash生效

~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件。

~/.bash_profile是交互式、login方式进入bash运行的;

~/.bashrc是交互式、non-login方式进入bash运行的;

通常前者会调用后者

【转】Linux中profile、bashrc、bash_profile之间的区别和联系的更多相关文章

  1. profile bashrc bash_profile之间的区别和联系

    profile bashrc bash_profile之间的区别和联系 博客分类: Linux   执行顺序为:/etc/profile -> (~/.bash_profile | ~/.bas ...

  2. profile bashrc bash_profile 之间的区别和联系

    /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个 ...

  3. linux profile\bashrc\bash_profile之间的区别和联系

    /etc/profile 每个用户,首次登录时被执行: /etc/bashrc 每个运行bash shell的用户都执行此文件,当bsh被打开时,该文件被读取: ~/.bash_profile 专用于 ...

  4. linux /etc/profile bashrc bash_profile

    文件: /etc/profile  ~/.bashrc  和  ~/.bash_profile 的使用区别: /etc/profile: 全局 环境变量等,在机器重启后执行一次, 用于设置环境变量,更 ...

  5. profile,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part 2

    profile,bashrc,.bash_profile,.bash_login,.profile,.bashrc,.bash_logout浅析 Part 2   by:授客 QQ:103355312 ...

  6. Linux中yum和apt-get用法及区别

    Linux中yum和apt-get用法及区别   一般来说著名的linux系统基本上分两大类:   1.RedHat系列:Redhat.Centos.Fedora等   2.Debian系列:Debi ...

  7. JavaScript中this和$(this)之间的区别以及extend的使用

    jQuery中this和$(this)之间的区别: this返回的是当前对象的html对象,而$(this)返回的是当前对象的jQuery对象 举个正确的Demo实例: $("#textbo ...

  8. linux中fork, source和exec的区别

    转:linux中fork, source和exec的区别 shell的命令可以分为内部命令和外部命令. 内部命令是由特殊的文件格式.def实现的,如cd,ls等.而外部命令是通过系统调用或独立程序实现 ...

  9. [转] C#中out和ref之间的区别

    gskcc 的原文地址 C#中out和ref之间的区别 首先:两者都是按地址传递的,使用后都将改变原来参数的数值. 其次:ref可以把参数的数值传递进函数,但是out是要把参数清空,就是说你无法把一个 ...

  10. Linux中profile与bashrc的作用

    文章同步发表在博主网站朗度云,传输门:http://www.wolfbe.com/detail/201608/278.html 在Linux系统上,我们会看到类似于profile和bashrc的文件, ...

随机推荐

  1. python html css 初识

    ##################总结############ 浏览器发请求 --> HTTP协议 --> 服务端接收请求 --> 服务端返回响应 --> 服务端把HTML文 ...

  2. mssql 数据库表行转列,列转行 比较经典

    --行列互转 /******************************************************************************************** ...

  3. excel vlookup简易样例【原】

    vlookup功能 vlookup主要用来做映射,就像java的map一样. 比如我要找id为2的学生对应的名字,那么在F7单元格录入=VLOOKUP(E7,$A$2:$B$4,2,FALSE) 实际 ...

  4. 牛客网数据库SQL实战(此处只有答案,没有表内容)

    1.查找最晚入职员工的所有信息   select * from employees order by hire_date desc limit 1; --limit n表示输出前n条数据,limit ...

  5. SQL中间

    -- 查询门诊挂号退费的账单:有4条记录 select * from `thc_rcm`.`Cs_AccountBill` a where a.orderSource = 1 and a.orderT ...

  6. Webpack2学习记录-1

    1.安装前准备 安装 webpack 之前,需要安装 node,这时最新的是 6,npm 是 4.如果有老的 node 项目在跑建议安装下 nvm. 2.建议安装在局部,即在项目下的 node_mod ...

  7. ****** 四十 ******、软设笔记【网络基础】-Internet和Intranet基础

    Internet和Intranet基础 一.网络地址及子网掩码 1.IP地址结构及类别 IP地址是由32位二进制数,即4个字节组成的,由网络号和主机号两个字段组成. 网络号的位数决定了可以分配的网络数 ...

  8. 一、linux 内核介绍

    参考文档: linux 内核剖析:https://www.ibm.com/developerworks/cn/linux/l-linux-kernel/ 1.1 linux 内核历史 在 20 世纪 ...

  9. 迅为IMX6开发板支持全网通4G模块丨GPS模块丨WIFI蓝牙丨千兆以太网

    迅为i.MX6开发板丨迅为i.MX6Q开发板丨四核imx6开发板丨Cortec-A9开发板丨资料介绍: 特点: 处理器:Freescale Cortex-A9四核i.MX6Q主频1GHz 核心板配置: ...

  10. TensorFlow从入门到理解(一):搭建开发环境【基于Ubuntu18.04】

    *注:教程及本文章皆使用Python3+语言,执行.py文件都是用终端(如果使用Python2+和IDE都会和本文描述有点不符) 一.安装,测试,卸载 TensorFlow官网介绍得很全面,很完美了, ...