exam questions

Exam LFCS All Questions

View all questions & answers for the LFCS exam

Exam LFCS topic 1 question 97 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 97
Topic #: 1
[All LFCS Questions]

Which of the following settings for umask ensures that new files have the default permissions -rw-r----- ?

  • A. 0017
  • B. 0640
  • C. 0038
  • D. 0027
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
rona962
2 months, 3 weeks ago
The correct setting for umask to ensure that new files have the default permissions -rw-r----- is option D, 0027. Explanation: The umask command is used to set the default file creation permissions for new files and directories. It works by subtracting the umask value from the maximum permissions allowed. The default permissions for files are 666 in octal (rw-rw-rw-), and the default permissions for directories are 777 in octal (rwxrwxrwx). To achieve -rw-r----- for new files, we need to subtract 027 (binary 000 010 111) from the default file permissions 666 (binary 110 110 110). The result of this subtraction is 640 (binary 110 100 000) in octal notation. Therefore, to ensure that new files have the default permissions -rw-r-----, the umask value should be set to 0027.
upvoted 1 times
...
sedwipe
2 years, 10 months ago
I don't agree, to determine the umask you should do: 0777-0027=0750 which is not reflecting the actual answer.
upvoted 1 times
jjnicks
2 years, 6 months ago
It is correct for file. Dir is 777- mask, file is 666-mask. A 7 in umask means no permission. Umask 0027 is 750(dir) and 640(file).
upvoted 5 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago