Octal basics — owner has read and write only If a file has read and write permissions for the owner (no execute), what is the single octal digit representing the owner’s permissions?
-
A1
-
B6
-
C5
-
D3
-
ENone of the above
Answer
Correct Answer: 6
Explanation
Introduction / Context:Unix permissions are often compressed into octal digits: one for owner, one for group, one for others. This question checks whether you can map “read+write only” into its correct octal digit.
Given Data / Assumptions:
- Owner has read (r) and write (w).
- Owner does not have execute (x).
- We only need the single digit for the owner, not the full three-digit mode.
Concept / Approach:
The mapping is r=4, w=2, x=1. Add the bits that are present to get the octal digit. For rw-, compute 4 + 2.
Step-by-Step Solution:
Assign bit values: r=4, w=2, x=1.Owner has r and w only: 4 + 2 = 6.Therefore, the owner digit is 6.Result can be part of a full mode like 640 (owner=6, group=4, others=0).Verification / Alternative check:
Create a file and run chmod u=rw,go=---. ls -l will show -rw-------; converting rw- to octal gives 6 for the owner.
Why Other Options Are Wrong:
- 1: represents execute only.
- 5: equals r+x (4+1), not rw.
- 3: equals w+x (2+1), not rw.
- None of the above: incorrect because 6 is correct.
Common Pitfalls:
Confusing the bit weights; thinking the digits are decimal instead of octal; forgetting that absence of execute for regular files is common by default.
Final Answer:
6