nerdexam
Linux_Foundation

LFCS · Question #869

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

The correct answer is A. chmod u=rwx,go=rx /bin/foo. To make a file executable by everyone but writable only by its owner, chmod can be used with the symbolic mode u=rwx,go=rx.

Submitted by viktor_hu· Apr 18, 2026Essential Commands

Question

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

Options

  • Achmod u=rwx,go=rx /bin/foo
  • Bchmod o+rwx,a+rx /bin/foo
  • Cchmod 577 /bin/foo
  • Dchmod 775 /bin/foo

How the community answered

(31 responses)
  • A
    77% (24)
  • B
    6% (2)
  • C
    13% (4)
  • D
    3% (1)

Why each option

To make a file executable by everyone but writable only by its owner, `chmod` can be used with the symbolic mode `u=rwx,go=rx`.

Achmod u=rwx,go=rx /bin/fooCorrect

The command `chmod u=rwx,go=rx /bin/foo` sets read, write, and execute permissions for the user (owner), and only read and execute permissions for the group and others, ensuring only the owner can write to the file while everyone can execute it.

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

`o+rwx` would grant write permission to others, which violates the requirement that the file should be writable only by its owner.

Cchmod 577 /bin/foo

`chmod 577` (r-x rwx rwx) grants write permission to both the group and others, contradicting the requirement for owner-only writability.

Dchmod 775 /bin/foo

`chmod 775` (rwx rwx r-x) grants write permission to the group, which contradicts the requirement that the file should be writable only by its owner.

Concept tested: `chmod` symbolic and octal modes

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

Topics

#chmod#File Permissions#Access Control#Linux Commands

Community Discussion

No community discussion yet for this question.

Full LFCS Practice