RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


Which command is equivalent to: chown :powerrangers mighty_morphin_file1?

  1. chown powerrangers mighty_morphin_file1

  2. chgrp powerrangers mighty_morphin_file1

  3. chown powerrangers: mighty_morphin_file1

  4. chmod powerrangers mighty_morphin_file1

The correct answer is: chgrp powerrangers mighty_morphin_file1

The command chown :powerrangers mighty_morphin_file1 is designed to change the group ownership of the file mighty_morphin_file1 to 'powerrangers', while leaving the user ownership unchanged. In Linux, the chown command is used for changing the owner and/or group of a file. When you specify only a colon followed by a group name (e.g., :powerrangers), it indicates that the user ownership is not altered, but the group ownership is set to 'powerrangers'. The command chgrp powerrangers mighty_morphin_file1 is specifically intended for changing the group ownership of a file. This alternative does precisely what the original command aims to achieve; it assigns the 'powerrangers' group to mighty_morphin_file1 without affecting the user ownership. Understanding the distinction between changing file ownership and group ownership is crucial. The command chown can change both, whereas chgrp is solely focused on the group. Therefore, chgrp powerrangers mighty_morphin_file1 behaves equivalently to the original command regarding the group ownership, confirming its correctness in this context.