The normal default umask value is 022 this value is subtracted from the default file permission of 666 in the case of a file which would give the files created a value of 644
This would translate to -rw-r--r-- where the first dash is used for file type in this case a regular file so what you are seeing as a result of setting the umask to 002 is correct.
The execute permission is not normally set by the umask because the assumption is not every file that will be created will need to be executable.
The way that specific file permission can be set is by using the chmod command in a script.
chmod 755 `ls` for example would set the file permission for all the files in the current directory to be
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.