Back to the command reference

chgrp

FilesFundamentals In simulator In real Linux

Change the group of files

Name: chgrp = change group

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

chgrp changes a file's group. The owner may switch to any group they belong to; other groups need root.

Syntax

chgrp [OPTION]... GROUP FILE...

Common options

-R / --recursiveOperate recursively
-h / --no-dereferenceChange the symbolic link itself, not what it points to
-v / --verbosePrint a line for every file processed
--reference FILEUse FILE’s group

Examples

  • $ sudo chgrp developers app.py

    Set the group to developers

    Explain

Related