Difficulty: Easy
Correct Answer: chmod ugo = r letter
Explanation:
Introduction / Context:
UNIX/Linux permissions protect files by specifying what actions each class of user can perform: read, write, and execute for user (u), group (g), and others (o). The chmod command modifies these bits either symbolically or numerically, and it is common to grant uniform read-only access to all classes for shared documents.
Given Data / Assumptions:
Concept / Approach:
Read-only means setting read and clearing write and execute for u, g, and o. Using symbolic mode, chmod ugo=r letter sets exactly the read bit for all classes at once. Alternatives either fail to remove existing write/execute bits or do not set all classes correctly.
Step-by-Step Solution:
Desired permissions: r-- r-- r-- (octal 444).Symbolic equivalent: ugo=r.Apply: chmod ugo = r letter.Confirm with ls -l to see -r--r--r-- for the file.
Verification / Alternative check:
Octal mode provides a quick check: chmod 444 letter yields the same result as ugo=r. Verifying with ls -l ensures correct application.
Why Other Options Are Wrong:
Option A only adds read for u and g and removes execute for o, leaving other bits unchanged.Option C removes read and write for all (a-rw) and leaves execute unchanged; not read-only.Option D adds read for g and o only, leaving user and other bits undefined.
Common Pitfalls:
Final Answer:
chmod ugo = r letter
Discussion & Comments