如何在 UNIX 中以默认文件权限为 rwx (777) 的方式设置 umask? [英] How to set umask in UNIX in a way that default file permission is rwx (777)?
问题描述
我对 UNIX 有点陌生,我正在尝试涵盖一组基本命令的各个方面,包括 umask
.
I am a bit new to UNIX and I'm trying to cover every aspect of a group of basic commands, including umask
.
我在互联网上做了很多研究,但到目前为止还没有找到正确的答案,我知道默认情况下文件是使用 666 (rw-,rw-,rw-) 权限创建的,我知道为了获得应用的真正权限,您需要考虑 umask
.
I have done a lot of research on the internet but haven't found a proper answer so far, I know that files are created by default with a 666 (rw-,rw-,rw-) permission and I know that in order to get the real permissions applied you need to take into consideration the umask
.
我想知道是否可以以使用 777 (rwx,rwx,rwx) 权限创建文件的方式设置 umask
.如果 umask
命令无法实现,那我该怎么做?
I would like to know if it's possible to set umask
in a way that files are created with a 777 (rwx,rwx,rwx) permission. If not possible with the umask
command, then how can I do it?
我已经知道 chmod ,但这意味着每次创建新文件时都使用它,这是我不想要的.
I already know about chmod but that means using it every time a new file is created, something I don't want.
推荐答案
简而言之,不能保证您能做到.这篇详细帖子中的更长版本:https://unix.stackexchange.com/questions/287278/为什么不-umask-change-execute-permissions-on-files
In short, there is no guarantee you can make that. Longer version in this detailed post: https://unix.stackexchange.com/questions/287278/why-doesnt-umask-change-execute-permissions-on-files
这篇关于如何在 UNIX 中以默认文件权限为 rwx (777) 的方式设置 umask?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!