/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.

并从/etc/profile.d目录的配置文件中搜集shell的设置.

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

~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该

文件仅仅执行一次!默认情况下,他设置一些环境变量,执行用户的.bashrc文件.

~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该

该文件被读取.

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



另外,/etc/profile中设定的变量(全局)的可以作用于任何用户,而~/.bashrc等中设定的变量(局部)只能继承/etc/profile中的变量,他们是"父子"关系.

 

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

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

通常二者设置大致相同,所以通常前者会调用后者。

/etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc ~/.bash_logout 说明及区别的更多相关文章

  1. /etc/rc.local ; /etc/init.d ;/etc/profile;/etc/bashrc;~/.bash_profile;~/.bashrc;~/.bash_logout

    1. /etc/rc.local 这是使用者自订开机启动程序,把需要开机自动运行的程序写在这个脚本里. 把脚本程序写在/etc/rc.d/init.d/目录下也可以  在完成 run level 3 ...

  2. etc/profile /etc/bashrc ~/.bash_profile ~/.bashrc等配置文件区别

    什么是交互式shell和非交互式shell,什么是login shell 和non-login shell. 交互式模式:就是shell等待你的输入,并且执行你提交的命令.这种模式被称作交互式是因为s ...

  3. linux中/etc/profile、/etc/profile.d/、/etc/bashrc、~/.bashrc、~/.bash_profile、~/.bash_logout的作用与区别

    作用: /etc/profile:登录时用来设置环境变量,执行文件中的命令,对所有用户生效. /etc/profile.d/:登录时和执行bash命令打开子shell时执行目录下所有已.sh结尾的脚本 ...

  4. 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 ...

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

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

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

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

  7. 【总结】/etc/rc.d/rc.local 与 /etc/profile .bash_profile .bashrc 文件执行顺序

    登陆shell与交互式非登陆shell的区别 登录shell 所谓登录shell,指的是当用户登录系统时所取的那个 shell.登录shell属于交互式shell. 登录shell将查找4个不同的启动 ...

  8. Bash: about .bashrc, .bash_profile, .profile, /etc/profile, etc/bash.bashrc and others

    Some interesting excerpts from the bash manpage:When bash is invoked as an interactive login shell, ...

  9. bashrc,bash_profile和/etc/profile

    bashrc,bash_profile和/etc/profile 最近老出现在shell里面能跑的程序用鼠标双击app去不能跑.究其原因是因为环境变量的问题. 在类unix系统中一般有三个bash配置 ...

随机推荐

  1. Dubbo Data length too large: 11557050, max payload: 8388608 传输数据超限

    com.alibaba.dubbo.remoting.transport.AbstractCodec.checkPayload() ERROR Data length too large: 11557 ...

  2. nginx解决方案

    nginx解决方案 1.方案场景 现有多台应用服务器,要实现所有的访问先访问到反向代理服务器上再转内部对应的应用. 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的 ...

  3. hdu_1695: GCD 【莫比乌斯反演】

    题目链接 这题求[1,n],[1,m]gcd为k的对数.而且没有顺序. 设F(n)为公约数为n的组数个数 f(n)为最大公约数为n的组数个数 然后在纸上手动验一下F(n)和f(n)的关系,直接套公式就 ...

  4. static关键字,引发的spring普通类获取spring的bean的思考

    在c++和java中static关键字用于修饰静态成员变量和成员函数 举例一个普通的javabean class AA { int a; static int b; geta/seta;//此处省略g ...

  5. [luogu P3786]萃香抱西瓜 [spfa][状态压缩]

    题目背景 伊吹萃香(Ibuki Suika)正在魔法之森漫步,突然,许多西瓜(Suika)从四周飞来,划出了绚丽的轨迹.虽然阵势有点恐怖,但她还是决定抱走一些西瓜. 题目描述 萃香所处的环境被简化为一 ...

  6. 【原创】01-1. 基于 checked 关于 attribute 和 property 的理解

    Attribute(属性) 和 Property(特性) Attribute(元素节点的属性),例如html中常用的class.title.align等(即:属性节点).而Property 是这个DO ...

  7. goroutine 加 channel 代替递归调用,突破递归调用的层级限制

    package main import ( "fmt" "github.com/davecgh/go-spew/spew" "github.com/B ...

  8. LNMP环境的安装

    一.LNMP的安装 1.准备工作 #清理已经安装包 rpm -e httpd rpm -e mysql rpm -e php yum -y remove httpd yum -y remove mys ...

  9. Python之系统交互(subprocess)

    本节内容 os与commands模块 subprocess模块 subprocess.Popen类 总结 我们几乎可以在任何操作系统上通过命令行指令与操作系统进行交互,比如Linux平台下的shell ...

  10. NodeJS项目迁移兼Ubuntu下NodeJS环境部署

    前言 之前做的几个项目都托管在阿里云服务器,但是最近要到期了.想着到底要不要续期,毕竟100/月.后面看着阿里云有个活动,800/三年.果断买下.环境部署折腾了一天,其中也遇到几个坑. 目录 一.安装 ...