几中常见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.
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 控制 文件 登陆 用户 it shell 目录 配置 bash 如果 if |
注册
个人空间
