O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

chgrp — stdin  stdout  - file  -- opt  --help  --version

Synopsis

chgrp [options] group_spec files

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 Group Management 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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required