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 questionsIn 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.
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.
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."
Keep practicing
Take the free 702-100 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 702-100 practice questions
- Question 1Which command can be used to display the local filesystems that are currently mounted'?
- Question 2Which line in a cron job runs myscript once per hour?
- Question 3Which FreeBSD command updates packages to newer versions'?
- Question 5A file called mybackup is found while investigating a USB pen drive. Which utility can be…
- Question 6Which of the following excerpts is a valid if condition in the Bourne shell?
- Question 7Which of the following lines in /etc/fstab mounts the device /dev/cd0a to /cdrom?
