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
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
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
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
hi haimathi1k,
how can you find these values?
113 for 640
117 for 660
Plz explain this...
---------------------
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 ***
Thanks Innila...Now i am very clear about this....
-----------------
suresh
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)
By default umask value 022 in solaris.
u can see the file vi /etc/profile.
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.