6

Please, can someone explain this to me?
I set:

umask 000
touch afile.tmp

result:

-rw-rw-rw- 1 jay apache 0 Aug 16 18:11 afile.tmp

I was expecting this:

-rw-rw-rw-

to be like this:

-rwxrwxrwx

Why isn't umask setting the 'x'`s of the permissions for new file modifications?

Ted
  • 955
  • 1
  • 8
  • 11

1 Answers1

4

umask is working precisely as expected - a mask of 0000 means permissions are 666 (rw-rw-rw-) for files and 777 (rwxrwxrwx) for directories. The execute bit is set for directories and not files. Case in point: the default umask is 0022, but files you create don't have the execute bit set by default, do they?

muru
  • 193,181
  • 53
  • 473
  • 722