010-150 · Question #39
What permissions are set on a file with the command chmod 654 file.txt?
The correct answer is E. -rw-r-xr--. The octal value 654 in chmod maps to rw-r-xr-- for owner, group, and others respectively, yielding the permission string -rw-r-xr--.
Question
What permissions are set on a file with the command chmod 654 file.txt?
Options
- Adrw-r-xr--
- Bd--wxr-x--
- C--wxr-x--x
- D-rwxrw---x
- E-rw-r-xr--
How the community answered
(20 responses)- A10% (2)
- B5% (1)
- D15% (3)
- E70% (14)
Why each option
The octal value 654 in chmod maps to rw-r-xr-- for owner, group, and others respectively, yielding the permission string -rw-r-xr--.
The leading 'd' denotes a directory, and the bit pattern does not match octal 654; this represents a directory with incorrect permissions.
The leading 'd' denotes a directory, and the bit pattern --wxr-x-- does not correspond to octal 654.
The bit pattern --wxr-x--x corresponds to octal 351, not 654.
The bit pattern -rwxrw---x corresponds to octal 761, not 654.
Each octal digit maps to a three-bit permission triplet: 6 (110) gives rw- for owner, 5 (101) gives r-x for group, and 4 (100) gives r-- for others. Combined with the regular file indicator '-', the full permission string is -rw-r-xr--, which matches choice E exactly.
Concept tested: Linux chmod octal permission notation
Source: https://man7.org/linux/man-pages/man1/chmod.1.html
Topics
Community Discussion
No community discussion yet for this question.