Difficulty: Easy
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:
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:
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:
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
Discussion & Comments