nerdexam
Linux_Foundation

LFCS · Question #743

Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?

The correct answer is D. chmod 755/bin/foo. The chmod 755 /bin/foo command sets file permissions so the owner has read, write, and execute permissions (7), while group and others have read and execute permissions (5), satisfying the requirement.

Submitted by obi.ng· Apr 18, 2026Essential Commands

Question

Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?

Options

  • Achmod 557 /bin/foo
  • Bchmod o+rwx.a+rx/bin/foo
  • Cchown 557 /bin/foo
  • Dchmod 755/bin/foo

How the community answered

(18 responses)
  • A
    6% (1)
  • C
    6% (1)
  • D
    89% (16)

Why each option

The `chmod 755 /bin/foo` command sets file permissions so the owner has read, write, and execute permissions (7), while group and others have read and execute permissions (5), satisfying the requirement.

Achmod 557 /bin/foo

`chmod 557` would make the file readable and executable by owner and group, but readable, writable, and executable by others, which is incorrect.

Bchmod o+rwx.a+rx/bin/foo

The syntax `o+rwx.a+rx` is incorrect; the correct syntax for adding permissions would be `o+rwx,a+rx`.

Cchown 557 /bin/foo

`chown` changes file ownership, not permissions, making it irrelevant to the question's requirement.

Dchmod 755/bin/fooCorrect

The `chmod` command with octal permissions 755 correctly sets the permissions for `/bin/foo`. The first digit '7' (binary 111) gives the owner read, write, and execute permissions, and the second and third digits '5' (binary 101) give the group and others read and execute permissions, making it executable by everyone but writable only by its owner.

Concept tested: Linux file permissions (chmod octal)

Source: https://learn.microsoft.com/en-us/windows-server/administration/linux-reference/linux-commands/chmod

Topics

#File Permissions#chmod#Octal Permissions#Access Control

Community Discussion

No community discussion yet for this question.

Full LFCS Practice