Linux for Developers Course
Linux for Developers
/
Beginner

chgrp

Definition

Change Group. A command specifically used to change the group ownership of a file or directory, without affecting the user ownership.

Explain Like I'm New

Changing which team is allowed to use a file, without changing the individual who owns it.

Real World Example

You create a project file. You want your entire engineering team to be able to edit it. You run `chgrp engineers project.txt`.

Common Use Cases

  • •Managing team access to shared folders

Interview Questions

basic

  • Why do people rarely use `chgrp`?

intermediate

  • Can a normal user change a file's group to a group they are NOT a member of?

Flash Cards

Question

Why rarely used?

Click to reveal answer
Answer

Because the `chown` command can change both the user and the group at the exact same time (e.g., `chown user:group`), making `chgrp` somewhat redundant.

Question

Change to external group?

Click to reveal answer
Answer

No. A regular user can only change a file's group to a group they are actively a member of.