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?

1 Answer 1

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?

2
  • 022 yields only -rw-r--r--.So, umask can't change the execute bits?
    – Ted
    Aug 16, 2014 at 17:29
  • @Ted not for files.
    – muru
    Aug 16, 2014 at 17:31

You must log in to answer this question.

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