Which command is used to change the group ownership of a file in UNIX?
a) chgrp
b) chmod
c) chown
d) grpmod
Answer:
a) chgrp
Explanation:
The chgrp
command in UNIX is used to change the group ownership of a file or directory. It allows the file’s owner or a system administrator to change the group that has access to the file. The syntax is chgrp group_name file_name
.
This is useful in multi-user environments where files need to be shared among group members. By assigning the correct group ownership, system administrators can ensure that only authorized group members can access or modify files.
Knowing how to use chgrp
is essential for managing group permissions on a UNIX system. It allows for better file access control, ensuring security and collaboration in shared environments.