Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried changing umask settings for some files as:

umask 0012 for file c:

-rw-rw-r-- 1 unipro unipro 0 2010-10-15 11:30 c

umask 0013 for file d:

-rw-rw-r-- 1 unipro unipro 0 2010-10-15 11:32 d

How is it that both have the same permissions, even after using different umask permissions?

share|improve this question
up vote 4 down vote accepted

From Wikipedia:

The umask only restricts permissions; it cannot grant extra
permissions beyond what is specified by the program that
creates the file or directory.

Real file permissions are calculated in this way:

real-permissions = requested-permissions AND NOT( umask )

requested-permissions is usually 0666 for files (and 0777 for directories), so:

0666 AND NOT( 0012 ) = 0664
0666 AND NOT( 0013 ) = 0664
share|improve this answer
Thank you .. +1 – Pavitar Oct 15 '10 at 20:21

Well 1 is execute, and umask can't add permissions, so I'm guessing neither of these files had +x set to begin with?

share|improve this answer
Yes>I got it now thank you :) +1 – Pavitar Oct 15 '10 at 20:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.