The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

chgrp: Changing File Group Ownership

The chgrp (change group) command is used to change the group ownership of files or directories. Common options include "-R" for recursive changes on directories.

When a file or directory is created, its owner and group ownership are initially set. However, you can use chown to change the owner and chgrp to change the group ownership for sharing and other purposes afterward.

Example:
# chgrp grp1 file ←Change the group ownership of the file to "grp1"
# chgrp -R newgroup mydir/ ←Change the group ownership of "mydir" and all its contents to the "newgroup"


For more chgrp examples, explanations, and parameters, please refer to the provided link.