How will you change the ownership of the file and group?
-
chown user:group file
-
chgrp user:group file
-
chown group:user file
-
chgrp group:user file
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.