Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6790315
  • 博文数量: 3857
  • 博客积分: 6409
  • 博客等级: 准将
  • 技术积分: 15948
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-02 16:48
个人简介

迷彩 潜伏 隐蔽 伪装

文章分类

全部博文(3857)

文章存档

2017年(5)

2016年(63)

2015年(927)

2014年(677)

2013年(807)

2012年(1241)

2011年(67)

2010年(7)

2009年(36)

2008年(28)

分类:

2012-10-17 19:34:38

命令行快捷键
ctrl-a:光标移至行首
ctrl-e:光标移至行尾
ctrl-u:光标删除至行首
ctrl-k:光标删除至行尾
ctrl-[arrow]:可使光标逐字向方向键移动

shell分为登录shell和非登陆shell
登录shell:一般能登录linux的用户
非登陆shell:shell为nologin

登录shell 启动脚本:配置文件
/etc/profile(全局)
~/.bash_profile(用户)

登录shell的脚本调用
当登录shell启动后,/etc/profile 脚本是首先运行的的启动脚本,此脚本将设置一系列变量,包括PATH,USER,LOGNAME,MAIL,HOSTNAME,HISTSIZE,INPUTRC,他还将运行在 /etc/profile.d 目录中找到的脚本。

登录shell首先调用/etc/profile,再由/etc/profile调用/etc/profile.d。然后调用文件~/.bash_profile。此文件再调用~/.bashrc 。而~/.bashrc 又会调用/etc/bashrc。每个脚本依次可以撤销之前调用脚本所做的更改。例如,在/etc/profile 脚本中设置PATH变量,但随后将在~/.bash_profile脚本中对此变量进行修改。

/etc/profile ——>/etc/profile.d/*——>~/.bash_profile ——>~/.bashrc ——>/etc/bashrc

非登陆shell 启动脚本:配置文件
/etc/bashrc (全局)
~/.bashrc(用户)

非登录shell的脚本调用
非登陆shell引用某些相同文件,但引用的顺序不同。非登陆shell首先调用~/.bashrc。它调用/etc/bashrc,而/etc/bashrc 又将调用/etc/profile.d。请注意,/etc/bashrc 文件仅为非登陆shell调用/etc/profile.d。对于登录shell,之前调用的/etc/profile将调用/etc/profile.d脚本。

~/.bashrc ——>/etc/bashrc——>/etc/profile.d/*

将更改的配置文件在终端里生效
. /etc/bashrc
source /etc/bashrc
阅读(265) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~