login 方式:: su - oracle
依次 /etc/bash.bashrc———— /home/$user/.bashrc ———— /ect/profile ———— /home/$user/.bash_profile(找不到~/.bash_profile, 则寻找~/.bash_login,若前两者不存在,读取~/.profile) -- 可见.profile的作用其实很次要的
正常

bash.bashrc
oracle .bashrc
etc profie
oracle .bash_profile

/home/oracle # mv .bashrc .bashrc2
bash.bashrc
etc profie!!
oracle .bash_profile

linux:/home/oracle # mv .bash_profile .bash_profile2
linux:/home/oracle # ..
linux:/home # su - oracle
bash.bashrc
etc profie!!
oracle . proflie

非login方式:————————图形界面? 等等。。 依次 /etc/bash.bashrc———— /home/$user/.bashrc
linux:/home/oracle # su oracle
bash.bashrc
oracle .bashrc

1. 图形模式登录时,顺序读取:/etc/profile和~/.profile ----(3)~/.profile ---- 图形模式登录时,此文件将被读取,即使存在~/.bash_profile和~/.bash_login

2. 图形模式登录后,打开终端时,顺序读取:/etc/bash.bashrc和~/.bashrc

3. 文本模式登录时,顺序读取:/etc/bash.bashrc,/etc/profile和~/.bash_profile ---- 貌似这里第二步少了个~/.bashrc

(5)和(6) 有些矛盾。。

后面的内容就太啰嗦了! 而且有些不对。不应该看。

Xshell:\> open 218
Connecting to 10.67.164.218:22...
Connection established.
Escape character is '^@]'.

Last login: Fri Apr 25 17:31:32 2014 from 10.74.169.50

etc bash.bashrc
.bash rc
etc profie!!
root . bash_profile (root 的根目录下没有.bash_profile 则新建一个)

可见这个顺序和su - root的顺序一样的

/etc/bash.bashrc 有的系统没有此文件,而对应的是 bashrc
/etc/profile

/export/home/$user ??
/home/$user/

.bashrc
.proflie
.bash_history ?

.inputrc ?

http://www.cnblogs.com/yangwindsor/articles/3380322.html
bashrc用于交互式non-loginshell,而profile用于交互式login shell

关于 bash & profile

其实明白了一点就很容易理解、记忆了,否则下次可能还是忘记::

bash  是shell 脚本, 执行shell 是不一定要登录的, 所以,他隐隐约约表示non-login

profile 是概括文件, 包含一些环境变量等等预处理变量、脚本、函数,  所以每次login 的时候都要执行一下

linux bash profile bash_profile 小结相关推荐

  1. linux中 bash_profile,Linux中profile、bashrc、bash_profile区别

    ~/.bash_profile.~/.bashrc.和~/.bash_logout 1.上面这三个文件是bash shell的用户环境配置文件,位于用户的主目录下.其中.bash_profile是最重 ...

  2. linux启动 profile,Linux 启动时profile、bashrc、~/.bash_profile、~/.bashrc、~/.bash_profile执行顺序以及文件说明...

    Linux 启动时profile.bashrc.~/.bash_profile.~/.bashrc.~/.bash_profile执行顺序以及文件说明 一.执行顺序 登录linux时,/etc/pro ...

  3. Linux Bash小结1

    1.Linux Bash变量类型 A 本地变量 B 环境变量 C 位置变量 D 特殊变量 需要注意的是: 父SHELL和子SHELL是两个不同的进程,他们不会共享本地变量. 环境变量对当前SHELL及 ...

  4. Linux设置环境变量小结

    1.总结背景 在linux系统下,如果你下载并安装了应用程序,很有可能在键入它的名称时出现"command not found"的提示内容.如果每次都到安装目标文件夹内,找到可执行 ...

  5. linux bash 学习

    1.什么shell ls /bin/*sh ash bsh-贝尔实验室--gnu  bash csh -c语言 --tcsh sun ksh--IBM unix--gnu/linux echo $PS ...

  6. linux /etc/profile文件,Linux 配置文件 /etc/profile

    Linux 配置文件 /etc/profile 1. 显示环境变量HOME $ echo $HOME /home/redbooks 2. 设置一个新的环境变量hello $ export HELLO= ...

  7. Linux设置环境变量小结:设置永久变量临时变量 全局变量局部变量

    1.总结背景 在linux系统下,如果你下载并安装了应用程序,很有可能在键入它的名称时出现"command not found"的提示内容.如果每次都到安装目标文件夹内,找到可执行 ...

  8. linux bash 变量_如何在Linux上的Bash中设置环境变量

    linux bash 变量 fatmawati achmad zaenuri/Shutterstock Fatmawati achmad zaenuri / Shutterstock There's ...

  9. Linux bash 的基础特性

    Linux bash 基础特性 bash基础特性之一:命令历史 bash基础特性之二:命令或路径补全 bash基础特性之三:命令行展开 bash基础特性之四:命令的执行状态结果 bash基础特性之五: ...

最新文章

  1. Flask之异常处理
  2. Hadoop的资源调度器
  3. golang 并发demo 写入 redis
  4. WEB程序打包详解:(连接SQL2005数据库,修改配置文件,建立虚拟目录)
  5. log4j slf4j实现_slf4j 与log4j logback的区别以及使用场景
  6. 在Teams中对网站的URL特殊解析
  7. php api 实例maccms,苹果cmsV10API接口说明
  8. 嵊州D5T2 折纸 folding
  9. 技术动态 | 自底向上构建知识图谱全过程
  10. 一个项目需要提交哪了些文档?
  11. 【优化算法】混沌博弈优化算法(CGO)【含Matlab源码 1803期】
  12. 【Oracle学习笔记】索引
  13. mysql学习之mysql集群
  14. 傻瓜式激活win10,真的太简单了,一个3.3M小软件只有一个激活按钮,点一下就激活了。
  15. 芯片代理商哪家专业 品质是否有保障
  16. IntelliJ Idea设置护眼浅绿色背景方法
  17. spotify歌曲下载_如何像真正的DJ一样让Spotify在歌曲之间进行淡入淡出
  18. 某注册页面存在手机短信验证码绕过
  19. 线性代数学习-矩阵在电流计算中的应用
  20. 涨点技巧:基于Yolov5的微小目标检测,多头检测头提升小目标检测精度

热门文章

  1. 大数据之-Hadoop完全分布式_集群中分发脚本xsync_集群环境中同时配置大量主机---大数据之hadoop工作笔记0033
  2. Sentinel降级_异常数_分布式系统集群限流_线程数隔离_削峰填谷_流量控制_速率控制_服务熔断_服务降级---微服务升级_SpringCloud Alibaba工作笔记0041
  3. springcloud工作笔记106---eureka实现服务监控_监控服务下线_服务注册_服务续约_判断注册中心可用_监控eurekaserver启动
  4. STM32工作笔记0096---用sprintf分配内存
  5. SpringCloud工作笔记051---SpringCloud打包部署流程
  6. Android学习笔记---28_网络通信之通过HTTP协议实现文件上传,组拼http 的post方法,传输内容
  7. 如何将数据库中的记录表导入到VC中
  8. eclisep安装反编译插件jadClipse
  9. 随想录(平台软件和项目代码)
  10. python编程(python开发的三种运行模式)