Linux umask command details how to use Linux umask command

Source: Internet
Author: User
Tags mkdir

Umask can be used to set the [permission mask]. The [permission mask] is composed of three octal numbers. After the existing access permissions are removed from the permission mask, the preset permissions for file creation can be generated.

Syntax

Umask [-S] [permission mask]

Parameter description:

-S indicates the permission mask in text format.

Instance

Run the following command to view the current permission mask:

$ Umask # obtain the current permission mask

After executing the preceding command, the output information is as follows:

0022

Next, run the command "mkdir" to create a directory and run the command "ls" to obtain detailed information about the directory. Enter the following command:

$ Mkdir test1 # Create a directory $ ls-d-l test1/# display the directory details

After executing the preceding command, the detailed information of the newly created directory is displayed, as shown below:

Drwxr-xr-x 2 rootlocal 4096 2011-9-19 test1/

Note: In the preceding output, "drwxr-xr-x" = "777-022 = 755 ".

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.