LPI
010-160 · Question #11
010-160 Question #11: Real Exam Question with Answer & Explanation
The correct answer is E: -rw-r-xr--. The octal value 654 passed to chmod maps to rw-r-xr-- for owner, group, and others respectively on a regular file.
Security and File Permissions
Question
Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?
Options
- Adrw-r-xr--
- Bd-wxr-x--
- C-rw-r-x-r
- D-rw-r-r--x
- E-rw-r-xr--
Explanation
The octal value 654 passed to chmod maps to rw-r-xr-- for owner, group, and others respectively on a regular file.
Common mistakes.
- A. The leading 'd' indicates a directory, not a regular file, so this string cannot represent the result of chmod on a regular file.
- B. A leading 'd' again incorrectly designates a directory, and the bits -wxr-x-- do not correspond to the octal values 6, 5, and 4.
- C. Standard Unix permission strings contain exactly 9 permission bits after the file-type character; a trailing standalone 'r' in position 10 is syntactically invalid.
- D. The others field shows '-r--x' which would be octal 5, not octal 4 as required; the correct others bits for digit 4 are r-- (read only, no execute).
Concept tested. Octal chmod notation and permission bit translation
Reference. https://man7.org/linux/man-pages/man1/chmod.1.html
Topics
#chmod#octal permissions#file permissions
Community Discussion
No community discussion yet for this question.