权限 drwxrwxr -x

Von*_*ton 21 permissions chmod 12.04

我需要一些有关许可的帮助。我有一个权限 drwxrwxr-x 但我尝试使用 chmod 755 /folder/ 更改权限,之后我收到了权限 drwxr-xr-x 但我想将其更改回 drwxrwxr-x。请问你能帮我解决这个问题吗?菲利普

pre*_*ise 34

因为drwxrwxr-x它是:

chmod 775  the_path_to_target
Run Code Online (Sandbox Code Playgroud)

因为drwxr-xr-x它是:

chmod 755  the_path_to_target
Run Code Online (Sandbox Code Playgroud)


smn*_*cks 24

永远记住以下几点

r - read
w - write
x - execute
Run Code Online (Sandbox Code Playgroud)

和权限矩阵是

7 = all rights
6 = read and write
5 = read and execute
4 = read only
3 = execute and write
2 = write only
1 = execute only
0 = no rights
Run Code Online (Sandbox Code Playgroud)

我认为这将帮助您了解权限,并通过添加+您授予权限和-您删除权限


小智 7

记住字母形式比记住数字更容易(在我看来)例如:

chmod a+w file
Run Code Online (Sandbox Code Playgroud)

标志之前的部分

拥有该文件的用户 (u)、文件组中的其他用户 (g)、不属于文件组的其他用户 (o) 或所有用户 (a)

标志

运算符+使选定的文件模式位添加到每个文件的现有文件模式位中;- 导致它们被移除;and = 导致添加它们并导致删除未提及的位,但目录未提及的设置用户和组 ID 位不受影响。

最后一部分

读 (r)、写 (w)、执行(或搜索目录)(x)

你可以跑

chmod a+rx file
chmod ug+w file
Run Code Online (Sandbox Code Playgroud)