exam questions

Exam 101-500 All Questions

View all questions & answers for the 101-500 exam

Exam 101-500 topic 1 question 82 discussion

Actual exam question from LPI's 101-500
Question #: 82
Topic #: 1
[All 101-500 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. 0227
  • E. 0027
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

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
dlus
Highly Voted 4 years, 4 months ago
umask 027: dirs 750, files 640
upvoted 8 times
...
RV025
Most Recent 2 months, 1 week ago
It would actually be 0026 since the default for files is 666. but the best practise is 0027
upvoted 1 times
...
NeoSam999
1 year, 10 months ago
Selected Answer: E
Default permissions: 777 = default permissions for directories 666 = default for files Default umask: 0002 To change umask: ~$ umask 027 ~$ umask 0027 To check new files have the default permissions -rw-r----- ~$ touch umask-test ~$ ls -l umask-test -rw-r----- 1 neo neo 0 Jan 1 18:01 umask-test Easy explanation: r = 4 w = 2 x = 1 Files with default 002: 666 - 022 = 644 Files with default 027: 666 - 027 = 644 0 = user / 2 = Group / 7 = Others Files: 666 - 027 = 640 = -rw-r-----
upvoted 3 times
NeoSam999
1 year, 10 months ago
Correction: Files with default 027: 666 - 027 = 640
upvoted 2 times
...
...
blk_542
2 years ago
0027: Initial 0: ignored second 0: rw for files (rwx for directories) 2: r for files (rx for directories) 7: nothing (for both files and directories)
upvoted 2 times
...
CuriousLinuxCat
3 years, 5 months ago
Closest I can get it to is 026.
upvoted 2 times
...
amwangi
3 years, 5 months ago
this answer is available coz its 0026
upvoted 1 times
...
Jcob
3 years, 9 months ago
Hang on but why it isnt 0137? I though since chmod RW-R---- is 640 I would guess it would be when eliminating the numbers 0/7/7/7 -0/6/4/0 0/1/3/7 can someone explain please?
upvoted 2 times
K1lroy
3 years, 9 months ago
I believe it is because files are by default rw- without x. So you don't need to take the 1 away
upvoted 3 times
...
...
mentor84
4 years, 6 months ago
Why not 0026? isn't these files with starting permissions of 666?
upvoted 4 times
jobwongdavila
4 years, 5 months ago
that's not a valid value for umask since it applies for directories as well
upvoted 3 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 ...