UNIX/Linux file permissions (octal to symbolic): The command 'chmod 761 note' sets permissions using octal notation. Which equivalent symbolic-mode command applies the same permissions to the file named 'note'?

Difficulty: Easy

Correct Answer: chmod u=rwx,g=rw,o=x note

Explanation:


Introduction / Context:
Understanding UNIX/Linux permissions is essential for system administration and secure software development. Permissions can be set either with octal numbers (like 761) or with symbolic expressions (like u=rwx,g=rw,o=x). This question checks whether you can translate octal permission codes into their exact symbolic equivalents for user (u), group (g), and others (o).



Given Data / Assumptions:

  • Target file: note.
  • Octal permissions specified: 761.
  • Standard UNIX permission mapping is used.


Concept / Approach:

Octal permission digits map to read (4), write (2), and execute (1) bits. Sum the bit values per class. Left to right the octal digits represent user, group, and others. Translate each digit to the corresponding r, w, x letters in symbolic notation.



Step-by-Step Solution:

Split 761 into user=7, group=6, others=1.For user=7: 4+2+1 = rwx, so u=rwx.For group=6: 4+2 = rw-, so g=rw.For others=1: 1 = --x, so o=x.Combine: chmod u=rwx,g=rw,o=x note


Verification / Alternative check:

Run ls -l note after applying permissions. You should see rwxrw--x (or equivalent, depending on default umask and file type) aligning with 761.



Why Other Options Are Wrong:

a: chmod 167 note reorders classes (would set u=1,g=6,o=7), not the intended 761 mapping.

c: Misspelled command and invalid syntax.

d: There is no syntax like 4=7 in chmod; classes are u, g, o (or a).

e: Not applicable because the correct symbolic form is available.



Common Pitfalls:

Confusing the order of classes (u,g,o), forgetting that 6 means rw (no x), or mixing up symbolic add mode (u+x) with full assignment mode (u=...).



Final Answer:

chmod u=rwx,g=rw,o=x note

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion