You want to change the owner of a file named /var/opt/confidential from alice (who is a member of the sales group) to john (who is a member of the engineers group). You want to change both user and group owners. Which of the following commands should you use?
  1. chown alice john /var/opt/confidential
  2. chown -u “john” -g “engineers” /var/opt/confidential
  3. chown john /var/opt/confidential
  4. chown john.engineers /var/opt/confidential
Explanation
Answer - D - You should use the chown john.engineers /var/opt/confidential command to change the owner of a file named /var/opt/confidential from alice to john.

Key Takeaway: Entering chown john.engineers /var/opt/confidential will change the user and group owners of the confidential file to john and engineers. The chown command is used to change the owner of a file. In most implementations, it can only be executed by the super user. Unprivileged users who wish to change the group of a file that they own may use chgrp.
Was this helpful? Upvote!
Login to contribute your own answer or details

Top questions

Related questions

Most popular on PracticeQuiz