免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1867 | 回复: 3
打印 上一主题 下一主题

chown 的怪问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-15 17:07 |只看该作者 |倒序浏览
今天不小心做个误操作,但也引出一个问题,

bash-2.05# pwd
/export/evadisk/home/hartlen
bash-2.05# ls -la
total 46
drwxr-xr-x   4 yyq  mail         512 Mar 10 18:34 .
drwxr-xr-x 486 yyq  mail       11264 May 14 11:08 ..
-rw-------   1 hartlen  mail        4042 Jun 26  2006 .bash_history
drwx------   7 hartlen  mail         512 Jun 16  2006 .openwebmail
-rw-------   1 hartlen  mail          54 Jun 26  2006 .sh_history
-rw-------   1 hartlen  mail         760 Nov  1  2006 .vacation.msg
drwx------   2 hartlen  mail         512 Sep 12  2006 mail
-rw-r--r--   1 hartlen  mail           7 Nov 30 15:19 sms.ok
-rw-r--r--   1 hartlen  mail          42 Jul  4  2006 tmp.txt
-rw-r--r--   1 hartlen  mail         163 Jul 12  2006 user.txt
我发现 ./ and ../ owner不是我
bash-2.05# chown -Rf hartlen ./
大家知道结果回是怎样吗。很出互我的预料
bash-2.05# cd /export/evadisk/home/
bash-2.05# ls -al
drwxr-xr-x   4 hartlen  mail         512 Sep 12  2006 mail
drwxr-xr-x   4 hartlen  mail         512 May 15  2006 yyq
drwxr-xr-x   4 hartlen  mail         512 Sep 12  2006 hartlen


bash-2.05# chown -Rf hartlen ../
bash-2.05# cd /export/evadisk/home/
bash-2.05# ls -al
drwxr-xr-x   4 hartlen  mail         512 Sep 12  2006 mail
drwxr-xr-x   4 hartlen  mail         512 Sep 12  2006 yyq
drwxr-xr-x   4 hartlen  mail         512 Sep 12  2006 hartlen
也是一样 这个还好理解一点,../ 就是/export/evadisk/home/
而后我的chown就是把/export/evadisk/home/下的所有owner都改变了

那为什么chown -Rf hartlen ./ 也会改变父文件夹下的使用文件夹的所有者啊!


bash-2.05# mkdir yyf
bash-2.05# cd yyf/
bash-2.05# ls -la
total 24
drwxr-xr-x   2 root     other        512 May 15 16:55 .
drwxr-xr-x 487 yyq  mail       11264 May 15 16:55 ..


bash-2.05# cd /export/evadisk
bash-2.05# ls -l
drwxr-xr-x   4 yyq mail         512 Sep 12  2006 home

感觉都是乱乱的!

哪个仁兄可以给个解释!

论坛徽章:
0
2 [报告]
发表于 2007-05-16 08:03 |只看该作者
There is no suprise here.
Let's say you are in /export/evadisk/home/hartlen directory.   . represents current directory, i.e. /export/evadisk/home/hartlen. So chown hartlen ./ changes the ownership of /export/evadisk/home/hartlen. If you issue chown hartlen ../ , it will change the ownership of /export/evadisk/home to hartlen.

论坛徽章:
0
3 [报告]
发表于 2007-05-17 10:40 |只看该作者
to 楼上
Let's say you are in /export/evadisk/home/hartlen directory.   . represents current directory, i.e. /export/evadisk/home/hartlen. So chown hartlen ./ changes the ownership of /export/evadisk/home/hartlen

现在是我chown hartlen ./  。 changes the ownership of /export/evadisk/home 下的所有fold的owner,不仅仅是 /export/evadisk/home/hartlen 文件夹

怪哉!

论坛徽章:
0
4 [报告]
发表于 2007-05-17 22:40 |只看该作者
现在是我chown hartlen ./  。 changes the ownership of /export/evadisk/home 下的所有fold的owner,不仅仅是 /export/evadisk/home/hartlen 文件夹

Can you duplicate the problem? That is not what I have experienced.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP