Score:1

Why doesn't "umask" work here?

cn flag

I want to set umask to 343.

I calculated that the permissions of the newly created files should be: -wx-w--wx

but I get: -r---w-r--

My terminal:

meliwex@reverse-proxy:~/testfolder$ ls -l
total 0
meliwex@reverse-proxy:~/testfolder$ umask 343
meliwex@reverse-proxy:~/testfolder$ touch file1
meliwex@reverse-proxy:~/testfolder$ ls -l
total 0
-r---w-r-- 1 meliwex meliwex 0 Nov  6 09:13 file1
meliwex@reverse-proxy:~/testfolder$ umask
0343
meliwex@reverse-proxy:~/testfolder$ 

I set this umask just for testing purposes.

cocomac avatar
cn flag
Welcome to Ask Ubuntu! Please don't post pictures of text, instead [edit] your question to include the text copy-pasted from your terminal. This makes it easier for us to help you.
Score:2
us flag

I'm not sure how you calculated that, but a mask of 3 (011 in binary) masks the write and execute bits (the second and third bits respectively). A mask of 4 (100 in binary) masks the read bit. Therefore a mask of 0343 will result in read permissions being set for user and other, and write permission being set for group (as the execute bit is masked for files anyway). And that's what you got.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.