TestOut Linux Pro Practice Test

Access More Questions
What command would you use to change group ownership of the /hr directory and all its contents to hr?
Correct Answer:
chgrp -R hr /hr
Explanation:
The command that changes group ownership of the /hr directory and all its contents to hr is correctly identified as chgrp -R hr /hr. This command specifically targets the group ownership without altering the user ownership, which is an important distinction. Using the -R flag enables recursive changes, ensuring that all files and subdirectories within /hr inherit the new group ownership. This is crucial in a directory structure where you want to maintain consistent group permissions across all contained items. While the other options involve different commands or functionalities that don’t achieve the goal of changing group ownership, this choice succinctly meets the requirement and best practices for managing group permissions within the Linux filesystem.

Access more questions from this quiz

Continue to TestOut Linux Pro Practice Test for more practice questions and the full quiz experience.

Access More Questions