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