Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the Linux basic command umask

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the usage of Linux basic command umask". In daily operation, I believe many people have doubts about the usage of Linux basic command umask. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the usage of Linux basic command umask"! Next, please follow the editor to study!

Umask

Specify the permission mask required to create the file, and the execution permission of the mask has no effect on the file. If the pattern begins with a number, it is interpreted as an octal number; otherwise, it is interpreted as a symbolic pattern mask, similar to the pattern mask accepted by chmod (1). If the mode is omitted, the current value of the mask is printed.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Umask [options] mask

2. List of options

Option

Description

-S

Represent the permission mask in character form

-P

Show current permission mask

3. Examples

1) View mask and create a directory

[root@localhost weijie] # umask / / without any parameters, you can view the mask, 0022

0022

[root@localhost weijie] # mkdir test / / create a directory

[root@localhost weijie] # ll-d test / / View

Drwxr-xr-x 2 root root 4096 September 14 10:44 test / / permission 755

2) create a file

[root@localhost weijie] # touch 11.c / / create a file

You have new mail in / var/spool/mail/root

[root@localhost weijie] # ll 11.c / / View permission

-rw-r--r-- 1 root root 0 September 14 10:46 11.c / / permission 644, because the execute permission in the mask has no effect on the file

3) modify the mask to create a directory

[root@localhost weijie] # umask 0033 / / modify the mask

[root@localhost weijie] # mkdir test/ create a directory

[root@localhost weijie] # ll-d test/ View permission

Drwxr--r-- 2 root root 4096 September 14 10:48 test/ permission is 744

At this point, the study of "the usage of the Linux basic command umask" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report