Geeks Talk

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.

umask value ?

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...

Go Back   Geeks Talk > Operating Systems > Unix/Linux
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 07-09-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 91 Times in 72 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
The Following User Says Thank You to psuresh1982 For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 07-13-2007
Expert Member
 
Join Date: Jun 2006
Location: India
Posts: 413
Thanks: 15
Thanked 43 Times in 31 Posts
jamesravid will become famous soon enough
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:)
Reply With Quote
  #3 (permalink)  
Old 07-13-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 91 Times in 72 Posts
psuresh1982 will become famous soon enough
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
Reply With Quote
  #4 (permalink)  
Old 07-16-2007
Junior Member
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
haimathi1k is on a distinguished road
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
Reply With Quote
  #5 (permalink)  
Old 07-16-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 91 Times in 72 Posts
psuresh1982 will become famous soon enough
Re: umask value ?

hi haimathi1k,

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

Plz explain this...

---------------------
suresh
Reply With Quote
  #6 (permalink)  
Old 07-16-2007
Expert Member
 
Join Date: Sep 2006
Location: India
Posts: 131
Thanks: 1
Thanked 21 Times in 20 Posts
Innila is on a distinguished road
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.
__________________
*** Innila ***

Last edited by Innila; 07-16-2007 at 06:28 AM.
Reply With Quote
The Following User Says Thank You to Innila For This Useful Post:
  #7 (permalink)  
Old 07-16-2007
Contributing Member
 
Join Date: Sep 2006
Location: bangalore, india
Posts: 1,016
Thanks: 0
Thanked 91 Times in 72 Posts
psuresh1982 will become famous soon enough
Re: umask value ?

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

-----------------
suresh
Reply With Quote
  #8 (permalink)  
Old 11-13-2007
Junior Member
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
casemanager is on a distinguished road
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)
Reply With Quote
  #9 (permalink)  
Old 12-25-2007
Junior Member
 
Join Date: Nov 2007
Location: kukatpally in hyderabad
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
jaykanthk is on a distinguished road
Re: umask value ?

By default umask value 022 in solaris.
u can see the file vi /etc/profile.
Reply With Quote
  #10 (permalink)  
Old 12-25-2007
Contributing Member
 
Join Date: Oct 2007
Location: trichy
Posts: 92
Thanks: 2
Thanked 13 Times in 9 Posts
sarathi trichy is on a distinguished road
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.
Reply With Quote
Reply

  Geeks Talk > Operating Systems > Unix/Linux

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 09:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved