{
    "mode": "man",
    "parameter": "CHGRP",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/CHGRP/1/json",
    "generated": "2026-06-15T18:53:51Z",
    "synopsis": "chgrp [OPTION]... GROUP FILE...\nchgrp [OPTION]... --reference=RFILE FILE...",
    "sections": {
        "NAME": {
            "content": "chgrp - change group ownership\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "chgrp [OPTION]... GROUP FILE...\nchgrp [OPTION]... --reference=RFILE FILE...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Change  the  group of each FILE to GROUP.  With --reference, change the group of each FILE to\nthat of RFILE.\n",
            "subsections": [
                {
                    "name": "-c --changes",
                    "content": "like verbose but report only when a change is made\n",
                    "flag": "-c",
                    "long": "--changes"
                },
                {
                    "name": "-f --silent --quiet",
                    "content": "suppress most error messages\n",
                    "flag": "-f",
                    "long": "--quiet"
                },
                {
                    "name": "-v --verbose",
                    "content": "output a diagnostic for every file processed\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "--dereference",
                    "content": "affect the referent of each symbolic link (this is the default), rather than the  sym‐\nbolic link itself\n",
                    "long": "--dereference"
                },
                {
                    "name": "-h --no-dereference",
                    "content": "affect  symbolic links instead of any referenced file (useful only on systems that can\nchange the ownership of a symlink)\n",
                    "flag": "-h",
                    "long": "--no-dereference"
                },
                {
                    "name": "--no-preserve-root",
                    "content": "do not treat '/' specially (the default)\n",
                    "long": "--no-preserve-root"
                },
                {
                    "name": "--preserve-root",
                    "content": "fail to operate recursively on '/'\n\n--reference=RFILE\nuse RFILE's group rather than specifying a GROUP value\n",
                    "long": "--preserve-root"
                },
                {
                    "name": "-R --recursive",
                    "content": "operate on files and directories recursively\n\nThe following options modify how a hierarchy is traversed when the -R option is  also  speci‐\nfied.  If more than one is specified, only the final one takes effect.\n",
                    "flag": "-R",
                    "long": "--recursive"
                },
                {
                    "name": "-H",
                    "content": "",
                    "flag": "-H"
                },
                {
                    "name": "-L",
                    "content": "",
                    "flag": "-L"
                },
                {
                    "name": "-P",
                    "content": "--help display this help and exit\n",
                    "flag": "-P"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n",
                    "long": "--version"
                }
            ]
        },
        "EXAMPLES": {
            "content": "chgrp staff /u\nChange the group of /u to \"staff\".\n\nchgrp -hR staff /u\nChange the group of /u and subfiles to \"staff\".\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Written by David MacKenzie and Jim Meyering.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright  ©  2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3 or later\n<https://gnu.org/licenses/gpl.html>.\nThis is free software: you are free to change and redistribute it.  There is NO WARRANTY,  to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "chown(1), chown(2)\n\nFull documentation <https://www.gnu.org/software/coreutils/chgrp>\nor available locally via: info '(coreutils) chgrp invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                    CHGRP(1)",
            "subsections": []
        }
    },
    "summary": "chgrp - change group ownership",
    "flags": [
        {
            "flag": "-c",
            "long": "--changes",
            "arg": null,
            "description": "like verbose but report only when a change is made"
        },
        {
            "flag": "-f",
            "long": "--quiet",
            "arg": null,
            "description": "suppress most error messages"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "output a diagnostic for every file processed"
        },
        {
            "flag": "",
            "long": "--dereference",
            "arg": null,
            "description": "affect the referent of each symbolic link (this is the default), rather than the sym‐ bolic link itself"
        },
        {
            "flag": "-h",
            "long": "--no-dereference",
            "arg": null,
            "description": "affect symbolic links instead of any referenced file (useful only on systems that can change the ownership of a symlink)"
        },
        {
            "flag": "",
            "long": "--no-preserve-root",
            "arg": null,
            "description": "do not treat '/' specially (the default)"
        },
        {
            "flag": "",
            "long": "--preserve-root",
            "arg": null,
            "description": "fail to operate recursively on '/' --reference=RFILE use RFILE's group rather than specifying a GROUP value"
        },
        {
            "flag": "-R",
            "long": "--recursive",
            "arg": null,
            "description": "operate on files and directories recursively The following options modify how a hierarchy is traversed when the -R option is also speci‐ fied. If more than one is specified, only the final one takes effect."
        },
        {
            "flag": "-H",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": "--help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit"
        }
    ],
    "examples": [
        "chgrp staff /u",
        "Change the group of /u to \"staff\".",
        "chgrp -hR staff /u",
        "Change the group of /u and subfiles to \"staff\"."
    ],
    "see_also": [
        {
            "name": "chown",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/chown/1/json"
        },
        {
            "name": "chown",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/chown/2/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Change group ownership of files and directories.",
        "examples": [
            {
                "description": "Change the owner group of a file/directory",
                "command": "chgrp {{group}} {{path/to/file_or_directory}}"
            },
            {
                "description": "Recursively change the owner group of a directory and its contents",
                "command": "chgrp {{-R|--recursive}} {{group}} {{path/to/directory}}"
            },
            {
                "description": "Change the owner group of a symbolic link",
                "command": "chgrp {{-h|--no-dereference}} {{group}} {{path/to/symlink}}"
            },
            {
                "description": "Change the owner group of a file/directory to match a reference file",
                "command": "chgrp --reference {{path/to/reference_file}} {{path/to/file_or_directory}}"
            }
        ]
    }
}