Linux commands: Masking code umask

Source: Internet
Author: User

umask Introduction to Commands

Umask command to display and set default permissions for files and directories

1 . Command format:

Umask mode modify default permissions for Umask

2 . Command function:

Set the default permissions for files and directories

3 . Command parameters:

Usmask mode

The file cannot have execute permissions by default, and if there are execute permissions in the result,

Add 1 to its permissions

Default permissions for new files =666-umask

Default permissions for the new directory =777-umask

4 . Command instance:

1, umask 022 set umask default value is 022

[Email protected] ~]# umask 022

[[email protected] ~]# umask Direct Input umask command, view umask current value

0022

[Email protected] test]# Ls-al

-rw-r--r--. 1 root root 0 October 11:42 A file a permission of 644=666-umask=666-022=644

Drwxr-xr-x. 2 root root 4096 October 11:42 a.directory directory a permission is 755=777-022



This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1862161

Linux commands: Masking code 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.