Which chmod mode setting would give “others” read and execute permissions on…
2021
Which chmod mode setting would give “others” read and execute permissions on the file temp?
Answer: A. chmod 755 — ConceptA three-digit numeric chmod mode assigns one octal permission digit each to the owner, the group, and others, in that order. Within a digit, read…
- A.
chmod 755
- B.
chmod 574
- C.
chmod 754
- D.
chmod 756
Show answer & explanation
Correct answer: A
Concept
A three-digit numeric chmod mode assigns one octal permission digit each to the owner, the group, and others, in that order.
Within a digit, read contributes 4, write contributes 2, and execute contributes 1; adding the required values forms that class’s digit.
Application
For read and execute permissions, add the permission values: 4 + 1 = 5.
Because the permission is for others, place 5 in the third (final) digit of the numeric mode.
Among the supplied modes, 755 has 5 as its final digit, so the full command for the named file is
chmod 755 temp.
Cross-check
Decoding the final digit of 755 gives 5 = 4 + 1, which corresponds to read and execute without write. The other final digits shown are 4 (read only) and 6 = 4 + 2 (read and write).
Result
Use chmod 755 temp.