Difficulty: Easy
Correct Answer: chmod 666 note
Explanation:
Introduction / Context:
Unix file permissions can be expressed symbolically (u, g, o with r, w, x) or numerically (octal). Converting between the two is a fundamental skill for system administration and scripting.
Given Data / Assumptions:
chmod ugo+rw note
.note
.
Concept / Approach:
Octal permission digits represent rwx as bits: r=4, w=2, x=1. For each of user, group, others, sum the bits enabled. With read and write set, value is 4+2=6. Applying to all three classes yields 6 6 6, so the octal is 666.
Step-by-Step Solution:
Verification / Alternative check:
Run chmod ugo+rw note
then ls -l note
: you will see -rw-rw-rw-
. Converting each triplet rw- to numbers confirms 6 for each class.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing execute with write; forgetting special modes (setuid/setgid/sticky) which would add a leading octal digit; assuming directories use the same mapping (they do, but execute means “traverse”).
Final Answer:
chmod 666 note
Discussion & Comments