登录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. Mysql查看sql是否走事务

    登陆进入server [root@gzmtest_25 ~]# su - mysql [mysql@gzmtest_25 ~]$ mysql.local Welcome to the MySQL mo ...

  2. 转:java身份证格式强校验

    package com.dsh.zealandweb.utils; import java.util.HashSet; import java.util.regex.Pattern; import o ...

  3. 【Cocos2dx】Windows平台下Cocos2dx 2.x的下载、安装、配置,打造自己的Helloworld

    Cocos2dx就不废话介绍了, 很火的游戏引擎.关键是它开源.能够免费下载.学习.开发.不用搞这么多激活的东西. 以下以Cocos2dx 2.x为例说明这个平台的一些基本东西.尽管如今Cocos2d ...

  4. P1052 过河(状态压缩)

    P1052 过河(状态压缩) 题目描述 在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧.在桥上有一些石子,青蛙很讨厌踩在这些石子上.由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把 ...

  5. bzoj 1034 [ ZJOI 2008 ] 泡泡堂BNB —— 贪心

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1034 一开始想了个很麻烦的贪心做法,对于每个 a[i],找第一个大于它的 b 匹配…… 然后 ...

  6. python 内存泄露的诊断

    对于一个用 python 实现的,长期运行的后台服务进程来说,如果内存持续增长,那么很可能是有了"内存泄露" 一.内存泄露的原因 对于 python 这种支持垃圾回收的语言来说,怎 ...

  7. leetcode排列组合相关

    目录 78/90子集 39/40组合总和 77组合 46/47全排序,同颜色球不相邻的排序方法 78/90子集 输入: [1,2,2] 78输出: [[], [1], [2], [1 2], [2], ...

  8. 移动App服务端架构设计

      我从事手机app服务端开发现在已经是3个年头,自己也整理出了一套相对好用的服务架构,写出来,跟大家一起分享.如有不足,还请多指教. 一:基础流程图. 其实有一点还需要加上,就是对json的压缩和加 ...

  9. .net core 下Web API 技术栈

    API文档工具:swagger https://www.cnblogs.com/suxinlcq/p/6757556.html https://www.cnblogs.com/danvic712/p/ ...

  10. B - Lucky Division

    Problem description Petya loves lucky numbers. Everybody knows that lucky numbers are positive integ ...