蜘蛛日记(七):用户登陆shell控制文件

发表于:2007-06-09来源:作者:点击数: 标签:
[这个贴子最后由南非蜘蛛在2002/12/1707:27pm编辑] 作者:南非蜘蛛zhedou@sohu.com 个人主页:http://www.douzhe.com 转载请保留作者信息 几中常见shell在用户目录下的控制文件 1)kornshell(ksh)-.profile.kshrc 2)bourneshell(sh)-.profile 3)cshell(csh)-.cs

[这个贴子最后由南非蜘蛛在 2002/12/17 07:27pm 编辑]

作者:南非蜘蛛 zhedou@sohu.com 
个人主页:http://www.douzhe.com
转载请保留作者信息

几中常见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.

 lyric 回复于:2002-10-20 17:08:48
老大,
你的图片弄个破轮子太难看了!
我把ROOT的SHELL给弄没了,怎么能改回来?


 中国UNIX用户 回复于:2002-10-20 17:11:15
[quote][b]下面引用由[u]lyric[/u]在 [i]2002/10/20 05:08pm[/i] 发表的内容:[/b]
老大,
你的图片弄个破轮子太难看了!
我把ROOT的SHELL给弄没了,怎么能改回来?
[/quote]

破轮子,不要小看哦,威力无比!

 lyric 回复于:2002-10-20 17:14:47
不是那个,转来转去的觉得很烦!
老大!

 lyric 回复于:2002-10-20 17:15:27
没有不穿衣服的那个会飞的好!

 南非蜘蛛 回复于:2002-10-20 17:30:30
[quote][b]下面引用由[u]lyric[/u]在 [i]2002/10/20 05:08pm[/i] 发表的内容:[/b]
老大,
你的图片弄个破轮子太难看了!
我把ROOT的SHELL给弄没了,怎么能改回来?
[/quote]
x86?sparc?是否还有其它机器?

 Fun-FreeBSD 回复于:2002-10-20 17:31:11
投票决定吧

 南非蜘蛛 回复于:2002-10-20 17:35:04
这个也要投票呀,看来我连一点人生自由都没有了
现在终于明白做演艺圈名人多辛苦了,做论坛名人更苦了,我好苦呀,苦苦苦.........

 lyric 回复于:2002-10-20 17:36:17
哈哈!!
那我就投没穿衣服的那个了!!

是X86, 


 南非蜘蛛 回复于:2002-10-20 17:38:33
http://202.108.44.138/cgi-bin/spboard45/board.cgi?id=a&page=1&action=view&number=103.cgi&img=no&category=sub_cmt&keyword=密码&start_num=

 旋风 回复于:2002-10-20 21:39:49
这几天为什么发不了帖子?

 旋风 回复于:2002-10-20 21:44:25
本人刚刚接触Solaris8,且用Ultra10练手,又遇不幸,请各位帮忙!
开机进不了公共用户界面,只能进入安全会话模式
如果选CDE,黑屏,并显示:
  DT 消息系统不能被启动
   检查主机名在这些位置是否正确
    /etc/src.sh
    /ect/hosts
    /usr/admin/inetd.sec

注:发不了新帖,我只好这样,原谅我吧

 南非蜘蛛 回复于:2002-10-21 10:10:08
那这几个文件都有吗?配置正确吗

 ultra-guest 回复于:2002-10-21 11:19:43
我进论坛从来都是3无的。

 laowu99 回复于:2002-10-21 13:07:36
马上要开16大了,这个轮子很危险的

 ultra-guest 回复于:2002-10-21 13:46:54
楼上的是王老五??这么亲切啊??

 sunspy 回复于:2002-10-21 15:01:18
蛛蛛你也太过个性了吧 ,你的魔力不会是转乾坤!

 sunnycn 回复于:2002-10-21 16:21:48
用那个命令来该用户默认的shell呀!


 南非蜘蛛 回复于:2002-10-21 17:13:01
/etc/passwd
usermod

 9命怪猫 回复于:2002-10-21 17:53:55
[这个贴子最后由9命怪猫在 2002/10/21 05:56pm 编辑]

[quote][b]下面引用由[u]lyric[/u]在 [i]2002/10/20 05:15pm[/i] 发表的内容:[/b]
没有不穿衣服的那个会飞的好!
[/quote]
蜘蛛姐姐原来用的那个头像会让人产生无穷的联想 :)

 allensxxx 回复于:2002-10-21 18:21:56
南非蜘蛛
你主页上的MM是你本人吗,还行就是有点胖 :)

 chenbq 回复于:2002-10-21 20:59:15
还好了,我喜欢的类型:真才实学!

不是拍马屁,呵呵

 sunmarmot 回复于:2002-10-23 00:36:38
总算上蜘蛛的主页了,原来是这样超级的漂亮!!!         

 YT 回复于:2002-10-30 11:47:00
16大的那个回复实在经典啊!!!!!

 川菜厨子 回复于:2002-11-06 15:39:58
bash shell的位置在哪啊?/bin/bash吗?

 南非蜘蛛 回复于:2002-11-06 15:51:06
which bash,改玩了shell,记得pwck一把

 川菜厨子 回复于:2002-11-06 19:43:31
就是支持历史命令的

 YT 回复于:2002-11-06 20:22:35
奉劝AS同志,与其关闭FTP,不如更改你的 LOGO。
。。。

 hfw 回复于:2002-11-06 22:07:33
轮子和十六大有什么关系
轮子就是法轮功吗?
^_^,所有带轮子的东西都惨了

 jeffcai 回复于:2002-11-06 22:18:08
当心被什么人认为是什么人的什么轮

咳,这年头,话都不能说了

 ipfreak 回复于:2002-11-07 02:11:14
>bash进的读取顺序: /etc/profile-->$HOME/.profile 

to 南非蜘蛛:

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.

for subshell, u have to have .bashrc. without .bashrc, u will loss ur working environmental parameters ...

btw, i am thinking about getting certified with sun too .. but i probably will skip sun admin stuff, go for Network Administrator and Certified Storage Architect directly. after all, the certification is just for resume. do u have course materials for storage architect, such as ES475? PM me if you have, tahnsk.



 川菜厨子 回复于:2002-11-07 21:18:12
改个默认SHELL路径不就行吗?我指BASH SHELL
我原来改过一次,但忘了路径了

 sunuser 回复于:2002-11-07 21:27:48
请看看一个有关本主题的一个实例吧。解决了这个问题,这个主题就过关了!http://www.chinaunix.net/cgi-bin/bbs/topic.cgi?forum=3&topic=14894&show=0


 川菜厨子 回复于:2002-11-07 23:44:29
我还以为是个很简单的问题~

 川菜厨子 回复于:2002-11-08 20:36:10
没跟的了

原文转自:http://www.ltesting.net