702-100 practice question 4 of 15

Assuming a umask of 022, what are the default permissions in octal mode of the newly created files?

Full set: 60 questions
Answer options
A: 022
B: 622
C: 644 Correct answer
D: 666
E: 755
Correct Answer:
C. 644
Explanation

In Linux, the default base permissions for newly created files are 666 (read and write for user, group, and others). The umask (user file-creation mode mask) value is used to remove permissions from this base value. The system calculates the final permissions by performing a bitwise AND operation between the base permissions and the bitwise NOT of the umask (basepermissions & ~umask). For a umask of 022: Base file permission: 666 ( rw-rw-rw- ) umask: 022 ( --- -w- -w- ) Result: 666 - 022 = 644 ( rw-r--r-- ) This removes the write permission for the group and for others, resulting in 644.

Why Incorrect

A. 022 This is the umask value itself, not the resulting file permission after the mask is applied.
B. 622 This permission (rw--w--w-) would result from an incorrect calculation or a different umask, such as 044.
D. 666 This is the system's default base permission for files before the umask is applied. The umask modifies this value.
E. 755 This is the typical default permission for a newly created directory (777 - 022), not a file.

References

1. Red Hat Enterprise Linux 9 Documentation: In "Configuring basic system settings", Section 3.5, "Controlling default file permissions with umask", it states: "For files, the base permissions are 666... If the umask value is 022, the default permissions for files are 644 (666-022)."

2. GNU Bash Reference Manual: Section 4.2, "Bash Builtin Commands", under the description for the umask command. It explains that the umask is used to control the default file-creation mode. The mode is modified by the umask at the time of creation.

3. University of Washington, CSE 374: In the "Linux File System" lecture notes, the section on "File Permissions" explains: "The umask is a mask of bits to turn off. Default file permissions are 666... With a umask of 022, new files are created with permissions 644."

Scroll to Top