Name

chgrp [options] group_spec files — coreutils

Synopsis

/bin stdin stdout - file -- opt --help --version

The chgrp (change group) command sets the group ownership of files and directories.

$ chgrp smith myfile myfile2 mydir

The group_spec parameter may be any of these possibilities:

  • A group name or numeric group ID

  • --reference=file, to set the same group ownership as another given file

See Working with Groups for more information on groups.

Useful options

--dereference

Follow symbolic links and operate on the files they point to.

-R

Recursively change the ownership within a directory hierarchy.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.