Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1690238
  • 博文数量: 136
  • 博客积分: 10021
  • 博客等级: 上将
  • 技术积分: 3261
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-22 11:26
文章分类

全部博文(136)

文章存档

2010年(1)

2009年(26)

2008年(109)

我的朋友

分类: LINUX

2008-12-09 21:58:56

1. 查看目录及当前文件

[root@localhost yuechaotian]# pwd
/home/yuechaotian
[root@localhost yuechaotian]# ll
总用量 8
drwxr-xr-x  3 root root 4096 12月  7 14:52 study
drwxr-xr-x  2 root root 4096 12月  9 21:43 test
[root@localhost yuechaotian]# ll test
总用量 12
-rwxr-xr-x  1 root root 11742 12月  9 21:43 conf.rd

2. 只改变目录test的用户及群组,并未改变目录test下的文件用户及群组

[root@localhost yuechaotian]# chown yuechaotian:dba test
[root@localhost yuechaotian]# ll
总用量 8
drwxr-xr-x  3 root        root 4096 12月  7 14:52 study
drwxr-xr-x  2 yuechaotian dba  4096 12月  9 21:43 test
[root@localhost yuechaotian]# ll test
总用量 12
-rwxr-xr-x  1 root root 11742 12月  9 21:43 conf.rd

3. 使用参数 -R,改变目录 test 及其文件用户和群组

[root@localhost yuechaotian]# chown root:root test
[root@localhost yuechaotian]# ll
总用量 8
drwxr-xr-x  3 root root 4096 12月  7 14:52 study
drwxr-xr-x  2 root root 4096 12月  9 21:43 test
[root@localhost yuechaotian]# chown -R yuechaotian:dba test
[root@localhost yuechaotian]# ll
总用量 8
drwxr-xr-x  3 root        root 4096 12月  7 14:52 study
drwxr-xr-x  2 yuechaotian dba  4096 12月  9 21:43 test
[root@localhost yuechaotian]# ll test
总用量 12
-rwxr-xr-x  1 yuechaotian dba 11742 12月  9 21:43 conf.rd

在 chmod 中使用 -R 参数,能达到同样的效果:该文件夹内的所有文件/文件夹都改为指定的权限.
阅读(52575) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~