In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to analyze the Linux system umask, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.
The main function of umask is to specify the default permission mask when creating the file, simply to control the default permissions.
Syntax: umask-S supplement: umask can be used to set [permission mask]. The permission mask consists of three octal digits. After the existing access permissions are subtracted from the permission mask, the default permissions when the file is created can be generated. Parameter:-S represents the permission mask in literal form. Files: using octal cardinality 666, that is, no x-bit (executable bit) rw- rw- rw-. The execution bit needs to be added by the user.
Example 1: suppose the file to be generated appears with a permission word such as rw- r-r -, that is, if the real permission is expressed as 644 in octal, it will be reduced to 022022 by the 666 cardinality, that is, the mask. Use umask 022.
Note: the effect of 033 is the same as that of 022. Assuming the 033 mask is used, the real permission should be 633, that is, rw-r- x rmurx, but the premise is that the file does not generate x bits, so the permissions of the file will eventually appear as rw-r-r-.
Table of contents: with octal base 777
Example 2: suppose the directory permissions to be generated appear with permission words such as rwxr-xr-x, that is, if the real permissions are expressed as 755 in octal, the mask 022 will be obtained after being subtracted by the permission words with a cardinality of 777. Is set using umask 022.
Summary:
Master two main points, first, the file base is 666, the directory is 777, that is, the file does not have x bits, the directory can be set x bits. Second, chmod is set to which bit, which bit will have permission, while umask is set to which bit, which bit will not have permission.
Example:
# umask00
# mkdir test# ls-ltrdrwxrwxrwx 2 root sys 96 Oct 11 11:10 test# umask022# umask022# mkdir test2# ls-ltrdrwxrwxrwx 2 root sys 96 Oct 11 11:10 testdrwxr-xr-x 2 root sys 96 Oct 11 11:11 test2
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
The above content is how to analyze Linux system umask. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.