- 论坛徽章:
- 381
|
- [root@rhel5 ~]#cd /tmp
- [root@rhel5 /tmp]#ll
- 总计 4.0K
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- [root@rhel5 /tmp]#mkdir testing
- [root@rhel5 /tmp]#ll
- 总计 8.0K
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- drwxr-xr-x 2 root root 4.0K 06-20 08:17 testing
- [root@rhel5 /tmp]#chmod 747 testing/
- [root@rhel5 /tmp]#ll
- 总计 8.0K
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- drwxr--rwx 2 root root 4.0K 06-20 08:17 testing
- [root@rhel5 /tmp]#cd testing/
- [root@rhel5 /tmp/testing]#touch a b c
- [root@rhel5 /tmp/testing]#cd ..
- [root@rhel5 /tmp]#su - chenyx
- [chenyx@rhel5 ~]$ cd /tmp
- [chenyx@rhel5 tmp]$ ll
- 总计 8.0K
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- drwxr--rwx 2 root root 4.0K 06-20 08:17 testing
- [chenyx@rhel5 tmp]$ rmdir testing/
- rmdir: testing/: 不允许的操作
- [chenyx@rhel5 tmp]$ rm -fr testing
- rm: 无法删除目录“testing”: 不允许的操作
- [chenyx@rhel5 tmp]$ ll
- 总计 8.0K
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- drwxr--rwx 2 root root 4.0K 06-20 08:18 testing
- [chenyx@rhel5 tmp]$ rm -fr testing
- rm: 无法删除目录“testing”: 不允许的操作
- ---------------------------------------------
- [chenyx@rhel5 tmp]$ cd abc/
- [chenyx@rhel5 abc]$ touch a b c
- [chenyx@rhel5 abc]$ cd ..
- [chenyx@rhel5 tmp]$ ll
- 总计 12K
- drwxrwxr-x 2 chenyx chenyx 4.0K 06-20 08:20 abc
- drwxr-xr-x 2 root root 4.0K 06-14 11:37 big
- drwxr--rwx 2 root root 4.0K 06-20 08:18 testing
- [chenyx@rhel5 tmp]$ rm -fr abc/
复制代码 tmp目录下,rm -fr也不行,原因是:tmp目录的权限是1777,只有文件创建者才有权限删除 |
|