101-500 practice question 12 of 30
Which of the following settings for umask ensures that new files have the default permissions -rw-r--- -- ?
Full set: 246 questionsThe umask value is a bitmask that removes permissions from the default creation modes. For files, the default mode is 666 (rw-rw-rw-). The desired permission is 640 (rw-r-----). To achieve this, the umask must remove the write permission for the group (020) and all permissions for others (007). Adding these together gives a mask of 027. Applying this mask (666 AND NOT 027) results in 640.
A. A umask of 0017 would result in file permissions of 660 (rw-rw----), not 640.
B. 0640 is a permission mode, not a typical umask value. If used as a mask, it would result in permissions of 026 (----w-rw-).
C. 0038 is not a valid octal number because the digit 8 is not part of the octal system (0-7).
- umask(2) Linux manual page. It describes umask() as setting the calling process's file mode creation mask.
- Red Hat Enterprise Linux 8 Documentation, "Configuring basic system settings", Chapter 10, "Controlling access to files with umask". This chapter details how the umask value is used to determine default file and directory permissions.
- Shotts, W. (2019). The Linux Command Line. No Starch Press. Chapter 7, "Permissions", explains the concept of umask and how to calculate resulting permissions.
Keep practicing
Take the free 101-500 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 101-500 practice questions
- Question 1Which of the following commands prints a list of available package updates when using RPM…
- Question 2Which of the following commands changes the number of days before the ext3 filesystem on …
- Question 3During a system boot cycle, what program is executed after the BIOS completes its tasks?
- Question 4Which of the following commands reboots the system when using SysV init? (Choose TWO corr…
- Question 5Which of the following commands updates the linker cache of shared libraries?
- Question 6Which of the following commands can be used to create a USB storage media from a disk ima…
