{
    "content": [
        {
            "type": "text",
            "text": "# chgrp (man)\n\n## NAME\n\nchgrp - change group ownership\n\n## SYNOPSIS\n\nchgrp [OPTION]... GROUP FILE...\nchgrp [OPTION]... --reference=RFILE FILE...\n\n## DESCRIPTION\n\nChange  the  group of each FILE to GROUP.  With --reference, change the group of each FILE to\nthat of RFILE.\n\n## TLDR\n\n> Change group ownership of files and directories.\n\n- Change the owner group of a file/directory:\n  `chgrp {{group}} {{path/to/file_or_directory}}`\n- Recursively change the owner group of a directory and its contents:\n  `chgrp {{-R|--recursive}} {{group}} {{path/to/directory}}`\n- Change the owner group of a symbolic link:\n  `chgrp {{-h|--no-dereference}} {{group}} {{path/to/symlink}}`\n- Change the owner group of a file/directory to match a reference file:\n  `chgrp --reference {{path/to/reference_file}} {{path/to/file_or_directory}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (12 subsections)\n- **EXAMPLES**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "chgrp",
        "section": "",
        "mode": "man",
        "summary": "chgrp - change group ownership",
        "synopsis": "chgrp [OPTION]... GROUP FILE...\nchgrp [OPTION]... --reference=RFILE FILE...",
        "tldr_summary": "Change group ownership of files and directories.",
        "tldr_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}}"
            }
        ],
        "tldr_source": "official",
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": [
                    {
                        "name": "-c --changes",
                        "lines": 2,
                        "flag": "-c",
                        "long": "--changes"
                    },
                    {
                        "name": "-f --silent --quiet",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--quiet"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--dereference",
                        "lines": 3,
                        "long": "--dereference"
                    },
                    {
                        "name": "-h --no-dereference",
                        "lines": 3,
                        "flag": "-h",
                        "long": "--no-dereference"
                    },
                    {
                        "name": "--no-preserve-root",
                        "lines": 2,
                        "long": "--no-preserve-root"
                    },
                    {
                        "name": "--preserve-root",
                        "lines": 5,
                        "long": "--preserve-root"
                    },
                    {
                        "name": "-R --recursive",
                        "lines": 5,
                        "flag": "-R",
                        "long": "--recursive"
                    },
                    {
                        "name": "-H",
                        "lines": 1,
                        "flag": "-H"
                    },
                    {
                        "name": "-L",
                        "lines": 1,
                        "flag": "-L"
                    },
                    {
                        "name": "-P",
                        "lines": 2,
                        "flag": "-P"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 8,
                "subsections": []
            }
        ],
        "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": []
            }
        }
    }
}