LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-20-2006, 01:55 AM   #1
greeting
LQ Newbie
 
Registered: Jun 2006
Posts: 17

Rep: Reputation: 0
Angry umask 027 037


Hi! everybody,

I am really confused with the umask value 027 and 037.

umask value 027 and 037 is working identically for files. Why???
If you set umask value to 027, the newly created file's permission is 640 (666 - 027 = 640). But, if you set umask value to 037 and create a new file. The file's permission is also 640 (666 - 037 = 640??).

All I know is that to get the file's permission, umask is subtracted from 666. And for directory, umask is subtracted from 777.

Regards,
aung kyaw soe
 
Old 06-20-2006, 02:11 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
its not 666 you substract from its 777. but since linux doesn't gives execute permission to files by default its coming the same. you have to explicity give execute permission for files.
 
Old 06-20-2006, 04:12 AM   #3
JunctaJuvant
Member
 
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X & Linux Mint
Posts: 488

Rep: Reputation: 31
AFAIK the action of umasking is not exactly to subtract, but to perform a bitwise AND of the inverse of the umask value (e.g. 0027 = 000010111 --> ~000010111 = 111101000 = 0750)

In your example:
Code:
666 in binary => 110110110
750 in binary => 111101000 (AND)
Result ======> 110100000 = 640

You get the same result with 0037 (~0037 = 0740):
666 in binary => 110110110
740 in binary => 111100000 (AND)
Result ======> 110100000 = 640
Hope that helps.
 
Old 06-20-2006, 11:30 PM   #4
greeting
LQ Newbie
 
Registered: Jun 2006
Posts: 17

Original Poster
Rep: Reputation: 0


I am really thank you,JunctaJuvant. It is very helpful for me. I am newbie to Linux and trying to sit LPIC 101. Can you give me any advice for that exam??

Regards,
greeting
 
Old 06-21-2006, 05:44 AM   #5
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Lpic - 101

Hi,

I recently sat for the LPI-101,102 exams and think I may be able to give you some pointers.
The exam's basically broken down into sections dealing with various topics, the critical areas being:

i) BIOS, Devices and other hardware issues - you'll be able to find some good documentation on this section at tldp.org. Lookup the Large-Disk-HOWTO and PPP-HOWTO.

ii) Common Linux utilities and commands (related to filesystem management, process control, stream editor utilities, etc). Its very important to get familiar with these commands and their most common options. For stream editor utilities experiment how different commands can be piped together and what output they produce.

iii) Package management utilities - learn how to manage packages using the RedHat package management system (RPM) and Debian's APT/DPKG utilities. There was plenty of documentation available regarding RPM but I couldn't find much on APT/DPKG (the DPKG-HOWTO does not cover all the material required for LPI-101). Installation, updating, uninstallation, verification, querying and checking the existing package database are all covered in this exam.

iv) Linux Filesystem Hierarchy - get familiar with the Linux filesystem hierarchy. Names and locations for important directories and files.

v) X Window System - Although this section is all the way at the bottom of the LPI 101 objectives list, don't underestimate this section. I made the mistake of just briefly browsing through the material and was stuck twiddling my thumbs for the last section of the exam.

Assuming that you've already installed a linux distro at home, one of the most important bit of advice I can give you is to explore and experiment. You may also consider taking the RedHat courses 033, 133, 253. Not strictly necessary but roughly around 65% of the material overlaps with LPI-101/102. Plus you'll gain some valuable hands on experience doing the lab work.

Practice exams can also help and there are plenty available on the internet.

Hope this helps and good luck!
 
Old 06-21-2006, 10:05 PM   #6
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
While JunctaJuvant's post is 100% correct, I think it might be a little hard to understand for newbies (maybe not the explanation, but the act of training yourself to think like this). Since with permissions, you can take each digit at a time, it is easier to think about it this way when say doing '6 AND 5 = 4' and '6 AND 4 = 4'.

At least I can understand this faster, because I only need to keep track of three binary digits at a time (as opposed to nine). Also note that the base permission of files is 666 whereas for directories, it is 777.
 
Old 06-21-2006, 11:52 PM   #7
greeting
LQ Newbie
 
Registered: Jun 2006
Posts: 17

Original Poster
Rep: Reputation: 0
Cool Thank you

Hi! everbody,

First of all, I would like to say thank you all for giving attention to my thread. I am familiar with binary operation. So, binary operation is not problem for me.
I have installed FC5 on my pc and make practices. And I read O'Relly's LPIC 101 exam guide and use testking test engine to sit virtual exam. Is it enought for LPIC 101 exam??

Regards,
greeting
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Umask Randvegeta Linux - Software 3 11-27-2009 07:52 AM
How to set defaul UMASK 037 sbrewer Linux - Software 2 09-15-2004 12:26 PM
umask trophy Linux - General 1 04-03-2004 01:17 AM
Umask robyso Linux - Security 1 07-14-2003 02:33 PM
umask Spaz17 Linux - Newbie 1 07-04-2003 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:30 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