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 > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what does umask refer to in linux". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Umask is a command in linux that is used to create a permission mask for user files with the syntax "umask [- S] [permission mask]". The "permission mask" is composed of three octal digits. After the existing access rights are subtracted from the permission mask, the default permissions are generated when the file is created.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Umask (user file-creatiopn mode mask) is a command in linux that specifies the default permission mask when the file is created.
The umask command determines the default permissions to be set on any file or directory created
The umask command creates a mask for user files, which is the basis of the default permissions when creating files or folders. Usually we can use chmod to modify the permissions of files in linux. Umask has the opposite effect as chmod, as shown below.
Without a file mask, the default permissions for files and folders are 0666 and 0777 respectively.
Reason:
Files are generally created for reading and writing, so by default all users have read and write permissions, but no executable permissions, so the default permission for file creation is 0666
The x permission of the folder represents the open permission, so this permission must be there, so the default permission of the folder is 0777.
User mask function
The above permissions are the default permissions without umask. However, in order to protect the user's right to create files and folders, the system will have a default user mask (umask). The default mask for most Linux systems is 022. The role of the user mask is to remove the permissions in the mask from the default permissions of the file when the user creates the file. So the permissions after the file is created are actually:
# File creation permissions default permissions (file 0666, folder 0777)-umask
Therefore, if the user does not modify the umask, the permission to create the file is: 0666-0022. 0644. The permission to create a folder is: 0777-0022-0755
View and modify the default mask
View the user mask:
# viewing the mask digitally umask# viewing the mask umask-S in symbolic form
You can use the umask command to modify the mask directly.
Umask 0000
The mask modified by the above method is only valid in the current tty. To take effect globally, you can write the umask value in / etc/profile or .bashrc
This is the end of the content of "what does umask in linux refer to". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.