nerdexam
Linux_Foundation

LFCS · Question #868

Which of the following commands changes the ownership of file.txt to the user dan and the group staff?

The correct answer is B. chown dan:staff file.txt. The chown command is used to change file ownership, and the correct syntax to specify both user and group is user:group.

Submitted by thandi_sa· Apr 18, 2026User and Group Management

Question

Which of the following commands changes the ownership of file.txt to the user dan and the group staff?

Options

  • Achown dan/staff file.txt
  • Bchown dan:staff file.txt
  • Cchown -u dan -g staff file.txt
  • Dchown dan -g staff file.txt

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    86% (25)
  • C
    3% (1)
  • D
    7% (2)

Why each option

The `chown` command is used to change file ownership, and the correct syntax to specify both user and group is `user:group`.

Achown dan/staff file.txt

The `/` character is not the correct separator for specifying user and group with `chown`; it is typically used for directory paths.

Bchown dan:staff file.txtCorrect

The `chown` command uses the `user:group` (or `user.group`) syntax to specify both the new user owner and the new group owner for a file, so `chown dan:staff file.txt` correctly changes the ownership.

Cchown -u dan -g staff file.txt

The `-u` and `-g` options are not valid or standard ways to specify the user and group owners directly for the `chown` command.

Dchown dan -g staff file.txt

The `-g` option is not the correct syntax for specifying the group when changing both user and group with `chown`; the correct format is `user:group`.

Concept tested: File ownership `chown` command syntax

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

Topics

#chown command#File Ownership#Group Ownership#Command Line

Community Discussion

No community discussion yet for this question.

Full LFCS Practice