LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-24-2005, 04:21 PM   #1
Paxmaster
Member
 
Registered: Jun 2004
Location: unknown place in NYC
Distribution: Ubuntu
Posts: 377

Rep: Reputation: 30
could someone explain me about umask


i just can't get it to my head, right now i am learning about umask, could someone tell me a better way to understand how it function

thanks
 
Old 01-24-2005, 04:35 PM   #2
Kethinov
Member
 
Registered: Oct 2003
Location: ESU, Student Teaching 5th Grade
Distribution: Ubuntu
Posts: 118

Rep: Reputation: 15
A umask is something you can apply as a mount option to volumes in the fstab. If you set the umask to 002 as an option in an fstab entry, the files will be read/write by all. Useful for mounting external devices or network devices as user read/write when they usually default to root only read/write.

The term umask however is more general and can be applied to many things.
 
Old 01-24-2005, 04:52 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Well, umask also applies to creating new files. Think of the umask setting as turning off the permissions it lists. If you're like me, and have a problem thinking that using a value means the opposite will come out, then think of it using subtraction. In other words, remember that all files can have a permission value of 777. When you create a file, you subtract the umask from 777.

So, if you have a umask of 022 (which is very common), then a new file created will have permissions of 777 - 022 = 755 (owner has all perms, group and other have read and execute perms).

One gotcha is this: the application that creates the file sometimes does not give the execute permission by default. For instance, if you used the touch command with a umask of 022, the file you create would be 777 - 111 (touch does not give execute) - 022 = 644 (owner has read & write, everybody else only has read).

Clear as mud?
 
  


Reply



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 Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Umask Randvegeta Linux - Software 3 11-27-2009 07:52 AM
Can someone explain umask jrmontg Linux - Newbie 3 01-11-2005 12:58 PM
umask trophy Linux - General 1 04-03-2004 01:17 AM
umask wbdune Linux - Newbie 5 10-14-2003 01:53 AM
umask knueven7 Linux - Newbie 8 04-18-2003 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration