1

如何计算umask的效果

 3 years ago
source link: https://www.lujun9972.win/blog/2019/07/09/%E5%A6%82%E4%BD%95%E8%AE%A1%E7%AE%97umask%E7%9A%84%E6%95%88%E6%9E%9C/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
如何计算umask的效果 - 暗无天日

如何计算umask的效果

只需要记住一点: Linux不允许直接创建带执行权限的文件,因此创建文件的最大权限为666,而不是跟目录一样是777.

正因为文件的这个特性,因此我们不能直接用 最大权限 - umask值 来计算对文件的影响。

只能根据 umask 的意义来进行计算, umask 代表的值是不设置的权限位,因此计算公式应该是 最大权限&(777-umask值)

比如 027 的umask值对应创建文件属性为 666&750=640,对应的目录权限为 777&750=750

2019-07-09 2019-07-09 linux和它的小伙伴 lujun9972

Related Issues not found

Please contact @lujun9972 to initialize the comment

Generated by Emacs 27.x(Org mode 9.x)

Copyright © 2014 - 2021 lujun9972   -   Powered by EGO
Themed with emacs_love


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK