Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok I do umask 0333, and then touch a file, and the file gets created with permissions of -r--r--r--, which is 0444. I thought that the file permissions are determined internally by ANDing the umask with another value, such as 0666 or 0777. But there is nothing that 0333 can be ANDed with to produce 0444. What am I missing here?
file_permision = requested_permision AND (NOT umask)
so with a umask of 022, trying to create a file with permission 777 will give it 755. requested permision is not necessarily 666 which you seemed to assume above.
Ok, I thought I had it- now I'm confused again. I guess I don't understand the concept of 'requested permission' as you described. What is it and how is it set? (Also why do you need it?) I guess I thought that the umask was a form of requested permissiion.
sorry, what i said is unimportant, requested permission defaults to 0666 when creating files and 0777 when creating directories. so if you create a directory with umask 002 it will have permision 775
if you are programming when you create a file or directory you have to specify what permissions you want the file to initially have, this is what i mean by requested permission, however ive just checked and touch and mkdir dont let you choose this, they use 0666 and 0777 respectivly
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.