LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   umask 027 037 (https://www.linuxquestions.org/questions/linux-newbie-8/umask-027-037-a-456456/)

greeting 06-20-2006 01:55 AM

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??). :confused:

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

prozac 06-20-2006 02:11 AM

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.

JunctaJuvant 06-20-2006 04:12 AM

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.

greeting 06-20-2006 11:30 PM

:D

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

Regards,
greeting

SlackDaemon 06-21-2006 05:44 AM

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!

osor 06-21-2006 10:05 PM

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.

greeting 06-21-2006 11:52 PM

Thank you
 
Hi! everbody,

First of all, I would like to say thank you all for giving attention to my thread. :p 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?? :Pengy:

Regards,
greeting


All times are GMT -5. The time now is 02:40 PM.