linux目录权限小记

r : 拥有读取目录结构列表的权限

x:拥有进入此目录的权限

w:

1: 建立新的档案和目彔; 2删除已经存在的档案和目录(无论该档案的权限为何!) 3能够重命名档案和目录; 4 能够移动目录里面的档案和目录。

如果在/tmp下面有个test目录,其权限如下

drwxrwxr-x. 4 root root 4096 11月  9 15:11 test

test目录里面有个档案名为testfile

-rw-r--r-x. 1 root root  137 11月  9 15:12 testfile 则其他用户对testfile只能有读和执行的权限。

但如果将test目录的权限改为如下格式:

[root@tarbitrary tmp]# chmod o+w test [root@tarbitrary tmp]# ls -ld test drwxrwxrwx. 4 root root 4096 11月  9 15:11 test

在这种情况下,即使其他用户对其目录下的testfile没有w权限,也可以对其进行强制写入,且强制写入后,档案的所属者及群组更改为当前编辑者及其所属群组.

原文地址:https://www.cnblogs.com/tarbitrary/p/4004641.html