Latest web development tutorials

Linux umask command

Linux command Daquan Linux command Daquan

Linux umask command specified when creating the default file permission mask.

umask used to set the [permission mask]. [Permission mask] is composed of three octal number consisting, after subtracting the existing access permissions mask, you can generate when you create a file default permissions.

grammar

umask [-S][权限掩码]

Parameter Description:

-S In written form to indicate permission mask.

Examples

Using the command "umask" to view the current permission mask, enter the following command:

$ umask                         #获取当前权限掩码 

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

0022

Next, use the command "mkdir" Create a directory and use the command "ls" for more information about the directory, enter the following command:

$ mkdir test1                       #创建目录  
$ ls –d –l test1/                   #显示目录的详细信息  

After executing the above command will display detailed information about the newly created directory, as follows:

drwxr-xr-x 2 rootlocal rootlocal 4096 2011-9-19 21:46 test1/ 

Note: The information in the above output, "drwxr-xr-x" = "777-022 = 755".

Linux command Daquan Linux command Daquan