[ 永远的UNIX::UNIX技术资料的宝库 ]

首页 > 系统管理 > 其它 > 正文
 

Unix用户登陆shell控制文件

作者:南非蜘蛛 来源:ChinaUnix (2007-02-06 15:14:11)

  几中常见shell在用户目录下的控制文件

  1)korn shell (ksh) - .profile .kshrc

  2)bourne shell (sh) - .profile

  3)c shell (csh) - .cshrc .login

  4)bash shell (bash) - .bash_profile .bash_login .profile

  在/etc/skel下,保存了用户的shell的模版文件。用admintool创建用户时系统不会将模版文件复制到用户主目录,而用useradd命令时系统会将相应用户设立了的模板复制到用户主目录并改名为相应的配置文件,如果想改变环境,修改这个文件就可以了.

  root的配置文件在/下,如果没有,用户可以自己创建.其他用户的配置文件在用户登陆目录下.

  用户登陆会先读系统标准配置文件,然后读自己目录下的文件,如果用户设置和默认不同,就改变值,如果用户没有设置,就用默认值.

  例如:bash进的读取顺序: $HOME/.profile-->/etc/profile

  bash is a bit different from sh.

  whenever the user log in the system, bash will look for .bash_profile; if it doesn't exist, it will look for bash_login; if it still doesn't exist, then it will look for .profile. if it can find none of them, finally it uses /etc/profile.

  of course, those files are under ${HOME} except /etc/profile.


(http://www.fanqiang.com)



 
 相关文章
TCSH shell变量和特征配置 2006-06-27 17:06:05
Shell程序设计的流程控制 2006-06-15 12:12:54
在Linux中批量建立用户的shell 2006-06-05 17:46:18
Unix系列shell程序编写(下) 2006-05-25 11:29:45
Unix系列shell程序编写(中) 2006-05-25 11:28:38
Unix系列shell程序编写(上) 2006-05-25 11:27:44
FreeBSD Shell的高级功能 2006-05-25 10:21:11
 

★  感谢所有的作者为我们学习技术知识提供了一条捷径  ★
www.fanqiang.com