"Linux" Umask

Source: Internet
Author: User

1. The umask value is 022 by default

[Email protected] ~]# umask0022

2.umask function

Default File Permissions: 666 (Linux Create file default no Execute permission)-umask =644 (6-0,6-2,6-2)

[email protected] ~]# Touch 1[[email protected] ~]# ll-al 1-rw-r--r--. 1 root root 0 May 31 18:03 1

Default directory Permissions: 777-umask=755 (7-0,7-2,7-2)

[Email protected] ~]# mkdir test[[email protected] ~]# ll-dl test/drwxr-xr-x. 2 root root 4096 18:04 test/

3.umask Modification:

Once you know the role of umask, you can modify the value of Umask, for example: Umask 024 The default permissions for files and directories that are created later are 642,753.

"Linux" Umask

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.