Set umask to 000 and create a regular file using the common requested mode 0666.
Assume no default ACL.
What mode is created?
umask only removes permissions from the requested mode. Even with umask 000, a regular file requested as 0666 does not gain execute bits.
Detailed explanation
0777Incorrect. 0777 is a directory-style mode and cannot be produced from the 0666 request by umask.
0666Correct. With umask 000, the requested regular-file mode remains 0666.
0600Incorrect. 0600 would require additional masking.
0000Incorrect. umask 000 does not remove every permission.
Try it yourself
An example you can run in a temporary verification environment.
umask 000; umaskExpected result
0000Key points
- Regular-file base mode is 0666
- umask is a removal mask
- It never adds execute bits
Notes
- Environment: Bash 5.2/POSIX umask
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.