nerdexam
LPI

010-100 · Question #47

Which of the following will change the group that is associated with a file?

The correct answer is C. chown. The 'chown' command changes file ownership and can also change the group associated with a file using the group syntax.

Security and File Permissions

Question

Which of the following will change the group that is associated with a file?

Options

  • Achmod
  • Bchmod -w
  • Cchown
  • Dls -g

How the community answered

(47 responses)
  • A
    4% (2)
  • B
    17% (8)
  • C
    72% (34)
  • D
    6% (3)

Why each option

The 'chown' command changes file ownership and can also change the group associated with a file using the group syntax.

Achmod

'chmod' modifies file permission bits (read, write, execute) and does not change group ownership.

Bchmod -w

'chmod -w' removes write permissions from a file and has no effect on group association.

CchownCorrect

'chown' changes both the owner and group of a file. To change only the group, you use 'chown :groupname filename' or 'chown owner:groupname filename'. It directly modifies the group association stored in the file's inode metadata, which is what the question requires.

Dls -g

'ls -g' is a listing command that displays group information but does not change anything.

Concept tested: Changing file group ownership with chown

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

Topics

#chown#file group ownership#file permissions

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice