gpt4 book ai didi

linux - 使用八进制表示法设置权限

转载 作者:太空宇宙 更新时间:2023-11-04 10:46:32 25 4
gpt4 key购买 nike

我知道权限是使用 Chmod 设置的,但我很难理解如何将八进制数转换为权限。

例如

640 does this mean that the user has rw-r----x permission? Becuase 4+2=6 and 4 = w and 0 = - ?

I understand that 777 is wide open because the user has full control fo the file 4+2+1 = 7 rwx permission the group has rwx and the second group has rwx permission If I were to answer this question my answer would be. rw-r----x What am I doing wrong?

最佳答案

有 3 个数字。第一位是用户权限,第二位是组权限,第三位是其他人的权限。

每个数字都是通过将 4(读取)、2(写入)、1(执行)的子集相加而形成的。

因此6 4 0表示允许用户(6)读写(4 + 2),组(4) ) 允许读取 (4),其他人 (0) 没有权限。

关于linux - 使用八进制表示法设置权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32854560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com