nerdexam
LPI

010-160 · Question #11

Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?

The correct answer is E. -rw-r-xr--. The octal value 654 passed to chmod maps to rw-r-xr-- for owner, group, and others respectively on a regular file.

Security and File Permissions

Question

Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?

Options

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

How the community answered

(58 responses)
  • A
    2% (1)
  • B
    16% (9)
  • C
    5% (3)
  • D
    3% (2)
  • E
    74% (43)

Why each option

The octal value 654 passed to chmod maps to rw-r-xr-- for owner, group, and others respectively on a regular file.

Adrw-r-xr--

The leading 'd' indicates a directory, not a regular file, so this string cannot represent the result of chmod on a regular file.

Bd-wxr-x--

A leading 'd' again incorrectly designates a directory, and the bits -wxr-x-- do not correspond to the octal values 6, 5, and 4.

C-rw-r-x-r

Standard Unix permission strings contain exactly 9 permission bits after the file-type character; a trailing standalone 'r' in position 10 is syntactically invalid.

D-rw-r-r--x

The others field shows '-r--x' which would be octal 5, not octal 4 as required; the correct others bits for digit 4 are r-- (read only, no execute).

E-rw-r-xr--Correct

The leading '-' denotes a regular file. Octal digit 6 (binary 110) assigns the owner rw-, octal 5 (binary 101) assigns the group r-x, and octal 4 (binary 100) assigns others r--. Combining the file-type character with the three permission triplets produces the string -rw-r-xr--, which matches choice E exactly.

Concept tested: Octal chmod notation and permission bit translation

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

Topics

#chmod#octal permissions#file permissions

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice