TestOut Linux Pro Practice Test

Question: 1 / 400

What is the correct command to change the group ownership of the /hr/personnel file to mgmt1?

chmod mgmt1 /hr/personnel

chgrp mgmt1 /hr/personnel

The command to change the group ownership of a file in Linux is `chgrp`. In this case, using `chgrp mgmt1 /hr/personnel` specifically targets the `/hr/personnel` file and changes its group ownership to `mgmt1`. This command directly fulfills the requirement of altering the group associated with the file, which is essential for managing permissions and access in a multi-user environment.

Other options do not serve this purpose. For instance, `chmod` is used to change the file permissions (i.e., read, write, execute rights) but does not affect ownership. The `chown` command, while similar, is primarily used for changing the owner of the file rather than its group, unless used in specific contexts with additional parameters. Lastly, `ls -l` is a command to list files and their properties, providing detailed information about permissions and ownership but does not make any changes to the file itself. For changing group ownership, `chgrp` is the appropriate and effective command.

Get further explanation with Examzify DeepDiveBeta

chown mgmt1 /hr/personnel

ls -l /hr/personnel

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy