linux bash & profile &bash_profile 小结
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 小结的更多相关文章
- Linux Bash终端快捷键小结
Ctrl + A 定位至行首 Ctrl + E 定位至行尾 Ctrl + U 向前删除至行首 Ctrl + K 向后删除至行尾 Ctrl + L 清屏
- Linux系统profile、bashrc、bash_profile等环境设置文件的使用
一.前言 关于bash的环境设置文件,分为系统设置和个人设置,一般来说建议用户直接修改个人的设置. 本文测试环境为:centos6.5. 二.系统设置值 1. /etc/sysconfig/i18n ...
- linux关于profile 、bashrc 、.bash_profile、.bashrc的区别
linux关于profile .bashrc ..bash_profile..bashrc的区别 - /etc/profile /etc/bashrc ~/.bash_profile ~/.bashr ...
- 【转】Linux(BASH)命令搜索机制
原文网址:http://www.mike.org.cn/articles/linux-linux-bash-command-search-mechanism/ 转自:Eric Cheung: Linu ...
- 【总结】/etc/rc.d/rc.local 与 /etc/profile .bash_profile .bashrc 文件执行顺序
登陆shell与交互式非登陆shell的区别 登录shell 所谓登录shell,指的是当用户登录系统时所取的那个 shell.登录shell属于交互式shell. 登录shell将查找4个不同的启动 ...
- Linux设置环境变量小结:设置永久变量&临时变量 全局变量&局部变量
1.总结背景 在linux系统下,如果你下载并安装了应用程序,很有可能在键入它的名称时出现“command not found”的提示内容.如果每次都到安装目标文件夹内,找到可执行文件来进行操作就太繁 ...
- (转)linux bash shell 入门教程
Shell Script(bash)简介 众所皆知地,UNIX上以小工具著名,利用许多简单的小工具,来完成原本需要大量软体开发的工作,这一点特色,使得UNIX成为许多人心目中理想的系统平台. 在众多的 ...
- linux bash变量作用域
linux bash变量作用域 一,思考一个问题,当在shell里执行某个程序时,shell是怎么找到这个程序的? shell会去$PATH环境变量定义的目录里去找这个命令.环境变量里一般包括/usr ...
- [转帖]linux bash环境变量简单总结
linux bash环境变量简单总结 来源链接:http://www.178linux.com/8005 原创文章,如有转载,请注明原文地址 需要简单学习一下. 其实 我都是直接放一个 .sh文件到 ...
随机推荐
- PS:缝线颜色随着鞋帮颜色的改变发生改变.files
1.绘制逼真缝线 (1)新建两个图层,并且命名为“针眼”和“缝线”: (2)选择“铅笔”工具,像素为“2”: (3)在针孔图层上进行缝线路径描边,并双击图层,弹出“图层样式”窗口,选择“斜面与浮雕”- ...
- MVC3在IIS7.5发布(部署)报403.14错误的解决办法
MVC3在IIS7.5发布(部署)报403.14错误的解决办法 错误现象: 报403.14 forbidden错误 web服务器被配置为不列出此目录的内容. 解决办法: 检查站点的处理程序映射 ...
- Rails中用CSV导出中文真心有技巧
require 'csv' class PartRequestsController < ApplicationController def render_csv_header(filename ...
- python基础第四天(1)
冒泡算法--算法 需求:请按照从小到大对列表 [13, 22, 6, 99, 11] 进行排序 思路:相邻两个值进行比较,将较大的值放在右侧,依次比较! 第一步 li = [13, 22, 6, 99 ...
- LeetCode(131)Palindrome Partitioning
题目 Given a string s, partition s such that every substring of the partition is a palindrome. Return ...
- Linux三剑客之grep 与 egrep
grep: Linux上文本处理三剑客 grep:文本过滤(模式:pattern)工具; *(grep, egrep, fgrep) sed:stream editor,文本编辑工具: awk:Lin ...
- react 15来了
有段时间没做react的项目了,前两天才发现react搞了一个不太小的动作,不是遵循原来的小版本号迭代,从0.14.x继续更新,而是直接跳到了15.0.X.虽然业界一直有这个观点,0.x的版本视为非稳 ...
- <Oracle Database>数据字典
数据字典 数据字典是由Oracle服务器创建和维护的一组只读的系统表,它存放了有关数据库和数据库对象的信息,Oracle服务器依赖这些信息来管理和维护Oracle数据库. 数据字典分为两大类:一种是基 ...
- MVC4 学习笔记 之 URL中存在编译的空格 20%20%
/Config/Edit/QQCC%20%20%20%20%20%20%20 原因是: 通过EF直接添加了空格? NO 是因为你的数据库字段设计问题,因为你当然设计如>:sID nchar(10 ...
- android wifi ANR问题分析总结
android wifi ANR问题分析总结 1 看看main进程阻塞在那里? 2 调用关系的函数阻塞在那里? 3 最终阻塞函数的阻塞前的log以及状态