Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I tried changing umask 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 different umask permissions.

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.