Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on umask value ? within the Unix/Linux forums, part of the Operating Systems category; 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...
|
|||||||
|
|||
|
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 |
| The Following User Says Thank You to psuresh1982 For This Useful Post: | ||
| Sponsored Links |
|
|||
|
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
__________________
Cheers, :) James:) |
|
|||
|
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 |
|
|||
|
Re: umask value ?
Quote:
Find the umask value 113 for 640 117 for 660 Thanks |
|
|||
|
Re: umask value ?
Quote:
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.
__________________
*** Innila *** Last edited by Innila; 07-16-2007 at 06:28 AM. |
| The Following User Says Thank You to Innila For This Useful Post: | ||
|
|||
|
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)
|
|
|||
|
Re: umask value ?
Quote:
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. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|