Results 1 to 10 of 10

Thread: umask value ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    umask value ?

    If I want the new files to be rw-r----- then what's the umask value ?

    If I want them to be rw-rw---- then what's the umask value ?

    -----------------
    suresh


  2. #2
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: umask value ?

    value for rw-r----- is 640
    and for rw-rw---- is 440

    as you know first three are for owner,second three for group users and the last three for others. Think each of them as a 3 digit binary number

    that is rwx = binary(111) = 7
    r-x = binary (101) = 5


  3. #3
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: umask value ?

    hi jamesravid,

    I think you are talking about the chmod value, not the umask value. I know the chmod value for this...

    user/group/others

    rwx / rws / rwx
    421 / 421 / 421

    rw-rw---- 4+2/4+2/ is 0660
    rw-r----- 4+2/4 is 0640

    But here i want umask value...how can i find it?

    ------------------
    suresh


  4. #4
    Junior Member
    Join Date
    Jun 2007
    Answers
    2

    Re: umask value ?

    Quote Originally Posted by psuresh1982 View Post
    hi jamesravid,

    I think you are talking about the chmod value, not the umask value. I know the chmod value for this...

    user/group/others

    rwx / rws / rwx
    421 / 421 / 421

    rw-rw---- 4+2/4+2/ is 0660
    rw-r----- 4+2/4 is 0640

    But here i want umask value...how can i find it?

    ------------------
    suresh
    ---------------------------------------------------------
    Find the umask value

    113 for 640
    117 for 660

    Thanks


  5. #5
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: umask value ?

    hi haimathi1k,

    how can you find these values?
    113 for 640
    117 for 660

    Plz explain this...

    ---------------------
    suresh


  6. #6
    Expert Member
    Join Date
    Sep 2006
    Answers
    130

    Re: umask value ?

    Quote Originally Posted by psuresh1982 View Post
    If I want the new files to be rw-r----- then what's the umask value ?

    If I want them to be rw-rw---- then what's the umask value ?

    -----------------
    suresh
    Hi Suresh,

    umask value can be derived by adding up the permissions for the category & then subtract the value with 7.

    It will be clear with an example,

    The value for read, write & execute permission is 4, 2 & 1 respectively for user, group & others.
    rwx-rwx-rwx
    421-421-421

    Let us take rw-r-----

    The user category value rw = r+w = 4+2 = 6. When this is subtracted from 7, the value is 1.

    The group category value r = 4. When this is subtracted from 7, the value is 3.

    The other category value is 0 because no permissions. When this is subtracted from 7, the value is 7.

    umask 137

    Similarly, for rw-rw----
    umask 117

    For more reference,
    http://www.unix.org.ua/orelly/networ...is/ch05_03.htm

    Hopefully its clear.

    Last edited by Innila; 07-16-2007 at 05:28 AM.
    *** Innila ***

  7. #7
    Contributing Member
    Join Date
    Sep 2006
    Answers
    962

    Re: umask value ?

    Thanks Innila...Now i am very clear about this....

    -----------------
    suresh


  8. #8
    Junior Member
    Join Date
    Mar 2007
    Answers
    2

    Re: umask value ?

    Not sure if the files are normal files or executable files. If the files you are referring to are normal then you need to subtract from 666 and if they are executable files ( like in case of directory) then you need to subtract from 777.(as pointed out by Innila)


  9. #9
    Junior Member
    Join Date
    Nov 2007
    Answers
    6

    Re: umask value ?

    By default umask value 022 in solaris.
    u can see the file vi /etc/profile.


  10. #10
    Contributing Member
    Join Date
    Oct 2007
    Answers
    88

    Re: umask value ?

    Quote Originally Posted by psuresh1982 View Post
    If I want the new files to be rw-r----- then what's the umask value ?

    If I want them to be rw-rw---- then what's the umask value ?

    -----------------
    suresh
    Read permission is assigned a numerical value of 4
    Write permission is assigned a numerical value of 2
    Execute permission is assigned a numerical value of 1
    both read and write permission a numerical value of 6
    read, write, and execute permission a numerical value of 7
    read and execute permission (but no write permission) a numerical value of 5
    The usual value for "umask" is 22 or, supplying the leading zero: 022

    Last edited by sarathi trichy; 12-25-2007 at 01:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact