0

I read "Linux Bible 10th Edition", chapter 4: Becoming a Linux Power User, at 109 page. Second paragraph:

$ umask
0002

If you ignore the leading zero for the moment, the umask value masks what is considered to be fully opened permissions for a file 666 or a directory 777. The umask value of 002 results in permission for a directory of 755 (rwxrwxr-x). That same umask results in a file permission of 644 (rw-rw-r--). (Execute permissions are off by default for regular files.)

I wonder why umask value of 002 is calculated for file like 644? As I understood 666 - 002 = 664. Btw, permissions in parentheses looks like 664.

1 Answer 1

4

It's got errors.

Here's what it should say,

If you ignore the leading zero for the moment, the umask value masks what is considered to be fully opened permissions for a file 666 or a directory 777. The umask value of 002 results in permission for a directory of 775 (rwxrwxr-x). That same umask results in a file permission of 664 (rw-rw-r--). (Execute permissions are off by default for regular files.)

The symbolic permissions are correct for the specified umask. The octal values are not. (This is one reason why it's almost always better to use symbolic permissions with chmod - it's far easier to see what is intended and can be less prone to typo mistakes.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .