nerdexam
Linux_Foundation

LFCS · Question #694

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

The correct answer is D. 0027. To ensure new files have default permissions of -rw- r----- (octal 640), the umask value should be set to 0027.

Submitted by ngozi_ng· Apr 18, 2026User and Group Management

Question

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

Options

  • A0017
  • B0640
  • C0038
  • D0027

How the community answered

(47 responses)
  • A
    2% (1)
  • B
    6% (3)
  • C
    11% (5)
  • D
    81% (38)

Why each option

To ensure new files have default permissions of `-rw- r-----` (octal 640), the umask value should be set to `0027`.

A0017

A umask of 0017 would result in default file permissions of 666 - 017 = 650 (-rw-r-x---), which includes execute permission for the group.

B0640

0640 represents a permission mode itself, not a umask value; if used as a umask, it would drastically alter permissions in an unintended way.

C0038

A umask of 0038 is not a valid octal representation for permissions because '8' is not a valid digit in octal numbering.

D0027Correct

Default permissions for new files are 666 (rw-rw-rw-). To achieve 640 (rw-r-----), the umask value is subtracted from the default. A umask of 027 subtracts 0 from owner (6-0=6), 2 from group (6-2=4), and 7 from others (6-7=0), resulting in 640.

Concept tested: umask and file permission calculation

Source: https://man7.org/linux/man-pages/man2/umask.2.html

Topics

#umask#file permissions#octal permissions#default permissions

Community Discussion

No community discussion yet for this question.

Full LFCS Practice