Which chmod mode setting would give “others” read and execute permissions on…

2021

Which chmod mode setting would give “others” read and execute permissions on the file temp?

Answer: A. chmod 755ConceptA three-digit numeric chmod mode assigns one octal permission digit each to the owner, the group, and others, in that order. Within a digit, read…

  1. A.

    chmod 755

  2. B.

    chmod 574

  3. C.

    chmod 754

  4. D.

    chmod 756

Show answer & explanation

Correct answer: A

Concept

A three-digit numeric chmod mode assigns one octal permission digit each to the owner, the group, and others, in that order.

Within a digit, read contributes 4, write contributes 2, and execute contributes 1; adding the required values forms that class’s digit.

Application

  1. For read and execute permissions, add the permission values: 4 + 1 = 5.

  2. Because the permission is for others, place 5 in the third (final) digit of the numeric mode.

  3. Among the supplied modes, 755 has 5 as its final digit, so the full command for the named file is chmod 755 temp.

Cross-check

Decoding the final digit of 755 gives 5 = 4 + 1, which corresponds to read and execute without write. The other final digits shown are 4 (read only) and 6 = 4 + 2 (read and write).

Result

Use chmod 755 temp.

Explore the full course: Up Police Computer Operator

Loading lesson…