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 ".