登录shell(login shell)会执行.bash_profile,.bash_profile中会执行.profile,.profile中会执行.bashrc

非登录shell(non-login shell)会执行.bashrc

An interactive login shell is started after a successful login, using /bin/login, by reading the /etc/passwd file. This shell invocation normally reads /etc/profile and its private equivalent ~/.bash_profile upon startup.
An interactive non-login shell is normally started at the command-line using a shell program (e.g., [prompt]$/bin/bash) or by the /bin/su command. An interactive non-login shell is also started with a terminal program such as xterm or konsole
from within a graphical environment. This type of shell invocation
normally copies the parent environment and then reads the user's
~/.bashrc file for additional startup configuration instructions.
A non-interactive shell is usually present when a shell script is
running. It is non-interactive because it is processing a script and not
waiting for user input between commands. For these shell invocations,
only the environment inherited from the parent shell is used.
The file ~/.bash_logout is not used for an invocation of the shell. It
is read and executed when a user exits from an interactive login shell.

Ubuntu的shell执行过程的更多相关文章

  1. shell查看执行过程及时间变量

    sh -xv test.sh    #加参数xv查看shell执行过程. Shell 调用系统时间变量 获取今天时期:`date +%Y%m%d` 或 `date +%F` 或date +%Y-%m- ...

  2. shell脚本学习—Shell执行脚本

    Shell作用是解释执行用户的命令,用户输入一条命令,Shell就解释执行这一条,这种方式称为交互式,但还有另一种执行命令的方式称为批处理方式,用户事先写一个Shell脚本,Shell可以一次把这些命 ...

  3. Shell执行脚本

    Shell作用是解释执行用户的命令,用户输入一条命令,Shell就解释执行这一条,这种方式称为交互式,但还有另一种执行命令的方式称为批处理方式,用户事先写一个Shell脚本,Shell可以一次把这些命 ...

  4. bash命令检测Shell脚本中的语法错误和查看详细执行过程

    (1).bash命令检测Shell脚本中的语法错误 bash -v [脚本] [root@youxi1 ~]# vim a.sh #/bin/bash sum=$[$1+$2] echoo $sum ...

  5. shell脚本编程之变量简介及脚本执行过程

    脚本变量简介 变量类型:字符型.数值型.真.假:事先确定数据的存放格式和长度: 变量存放在内存空间: 编译型语言,没有额外的处理逻辑,属于强类型语言: 脚本型语言,可以有解释器控制:所以,可以是弱类型 ...

  6. Java中JIN机制及System.loadLibrary() 的执行过程

    Android平台Native开发与JNI机制详解 http://mysuperbaby.iteye.com/blog/915425 个人认为下面这篇转载的文章写的很清晰很不错. 注意Android平 ...

  7. Ubuntu常用shell命令

    目录 ls cd mkdir mv cp scp rm df du chmod chown chgrp head tail screen apt-get Ubuntu常用shell命令 Ubuntu作 ...

  8. openstack nova 源码解析 — Nova API 执行过程从(novaclient到Action)

    目录 目录 Nova API Nova API 的执行过程 novaclient 将 Commands 转换为标准的HTTP请求 PasteDeploy 将 HTTP 请求路由到具体的 WSGI Ap ...

  9. 结合中断上下文切换和进程上下文切换分析Linux内核的一般执行过程

    结合中断上下文切换和进程上下文切换分析Linux内核的一般执行过程 目录 结合中断上下文切换和进程上下文切换分析Linux内核的一般执行过程 一. 实验准备 二. 实验过程 I 分析中断上下文的切换 ...

随机推荐

  1. Android LaunchAnyWhere (Google Bug 7699048)漏洞具体解释及防御措施

    開始 近日,Google修复一个组件安全的漏洞LaunchAnyWhere(Google Bug 7699048). 这个漏洞属于Intend Based提取漏洞,攻击者利用这个漏洞,能够突破了应用间 ...

  2. ZOJ 3213

    /* ZOJ 3213 好吧,看过那种括号表示法后,就崩溃了,实在受不了.情况复杂,写了两天,人也有点傻X了,只能放弃,转而用最小表示法. 最小表示法不难写: 1)首先,要承认路径上有格子不选的情况, ...

  3. 怎样给你的Android 安装文件(APK)瘦身

    本文源地址:怎样给你的Android 安装文件(APK)瘦身 Android的apk文件越来越大了这已经是一个不争的事实. 在Android 还是最初版本号的时候,一个app的apk文件大小也还仅仅有 ...

  4. Zend_Form 创建、校验和解析表单的基础--(手冊)

    1.  创建表单对象 创建表单对象很easy:仅仅要实现 Zend_Form: <?php $form = newZend_Form; ? > 对于高级用例.须要创建 Zend_Form ...

  5. ASP.NET—016:ASP.NET中保存文件对话框

    本想在asp.net中使用savediallog保存文件,结果提示:当应用程序不是以 UserInteractive 模式执行时显示模式对话框或窗口是无效操作. 在ASP.NET中使用例如以下方式.保 ...

  6. 反射调用android系统级API函数

    try { Class<?> mClass = Class.forName("com.android.server.wifi.WifiSettingsStore"); ...

  7. MySql免安装版l配置方法

    初次接触mysql,折腾了一天,总是安装不成功,服务启动不了.后来从官网下载了ZIP Archive版,不用安装,直接把它解压到磁盘,做一些简单的配置就可以. 软件下载地址:http://dev.my ...

  8. Android eclipse导入项目后出现Unable to resolve target &#39;android-17&#39;解决方法

    eclipse导入项目后出现Unable to resolve target 'android-17'解决方法.在最后附带还有一种编译逻辑不成功情况解决方法. 一.问题情况 二.解决的方法 1.改动项 ...

  9. Android入门之文件系统操作(一)简单的文件浏览器

    版权声明:本文为博主原创文章,未经博主允许不得转载.       import java.io.File; import java.util.*; import android.app.Activit ...

  10. bzoj4197 [Noi2015]寿司晚宴——状压DP

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4197 首先,两个人选的数都互质可以看作是一个人选了一个数,就相当于选了一个质因数集合,另一个 ...