Multiple choice technology operating systems

How will you change the ownership of the file and group?

  1. chown user:group file

  2. chgrp user:group file

  3. chown group:user file

  4. chgrp group:user file

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The chown user:group file command changes both the owner and group of a file simultaneously. The syntax is chown owner:group filename. This is the standard Unix/Linux command for changing file ownership. Option B (chgrp) only changes group ownership. Option C has the syntax reversed (group:user). Option D is also chgrp with reversed syntax.