nerdexam
LPI

010-150 · Question #39

What permissions are set on a file with the command chmod 654 file.txt?

The correct answer is E. -rw-r-xr--. The octal value 654 in chmod maps to rw-r-xr-- for owner, group, and others respectively, yielding the permission string -rw-r-xr--.

Security and File Permissions

Question

What permissions are set on a file with the command chmod 654 file.txt?

Options

  • Adrw-r-xr--
  • Bd--wxr-x--
  • C--wxr-x--x
  • D-rwxrw---x
  • E-rw-r-xr--

How the community answered

(20 responses)
  • A
    10% (2)
  • B
    5% (1)
  • D
    15% (3)
  • E
    70% (14)

Why each option

The octal value 654 in chmod maps to rw-r-xr-- for owner, group, and others respectively, yielding the permission string -rw-r-xr--.

Adrw-r-xr--

The leading 'd' denotes a directory, and the bit pattern does not match octal 654; this represents a directory with incorrect permissions.

Bd--wxr-x--

The leading 'd' denotes a directory, and the bit pattern --wxr-x-- does not correspond to octal 654.

C--wxr-x--x

The bit pattern --wxr-x--x corresponds to octal 351, not 654.

D-rwxrw---x

The bit pattern -rwxrw---x corresponds to octal 761, not 654.

E-rw-r-xr--Correct

Each octal digit maps to a three-bit permission triplet: 6 (110) gives rw- for owner, 5 (101) gives r-x for group, and 4 (100) gives r-- for others. Combined with the regular file indicator '-', the full permission string is -rw-r-xr--, which matches choice E exactly.

Concept tested: Linux chmod octal permission notation

Source: https://man7.org/linux/man-pages/man1/chmod.1.html

Topics

#chmod#octal permissions#file permissions#symbolic notation

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice