前提: 

mode权限设定字串。格式:[ugoa...][[+-=][rwxX]...][,...]

    当中u表示拥有者(user)。g表示与拥有者属于同一个群体(group),o表示其它以外的人(other),a表  示这三者皆是。

  +表示添加权限,-表示取消权限。=表示唯一设定权限。

r:表示可读取,w表示可写入,x表示可运行。



当中a,b,c各为一个数字,a表示User,b表示Group。c表示Other的权限。

r=4,w=2。x=1

若要rwx(可读、可写、可运行)属性,则4+2+1=7

若要rw-(可读、可写、不可运行)属性,则4+2=6

若要r-w(可读、不可写、可运行)属性,则4+1=5


范例:

chmod a=rwx file 和 chmod 777 file 效果同样

chmod ug=rwx,o=x file 和 chmod 771 file 效果同样

若用chmod 4755 filename可使此程式具有root的权限




相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-08-31
  • 2021-10-28
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
猜你喜欢
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案