nerdexam
LPI

010-150 · Question #72

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 associated group using the 'chown user:group' or 'chown :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

(43 responses)
  • A
    12% (5)
  • B
    5% (2)
  • C
    81% (35)
  • D
    2% (1)

Why each option

The chown command changes file ownership and can also change the associated group using the 'chown user:group' or 'chown :group' syntax.

Achmod

chmod changes permission bits (read, write, execute) on a file but does not affect which user or group owns it.

Bchmod -w

'chmod -w' removes write permission from a file's permission bits and has no effect on group ownership.

CchownCorrect

chown (change owner) accepts an optional group component in the form 'chown owner:group file' or 'chown :group file', allowing the file's associated group to be changed. While chgrp is the dedicated group-change command, chown is the answer here as it is the only listed command capable of changing group association.

Dls -g

'ls -g' is a listing flag that displays group information in output but does not modify any file attributes.

Concept tested: Changing file group ownership with chown

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

Topics

#chown#group ownership#file permissions#ownership change

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice