{
    "mode": "man",
    "parameter": "grpck",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/grpck/8/json",
    "generated": "2026-05-30T07:09:09Z",
    "synopsis": "grpck [options] [group [ shadow ]]",
    "sections": {
        "NAME": {
            "content": "grpck - verify integrity of group files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "grpck [options] [group [ shadow ]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The grpck command verifies the integrity of the groups information. It checks that all\nentries in /etc/group and /etc/gshadow have the proper format and contain valid data. The\nuser is prompted to delete entries that are improperly formatted or which have other\nuncorrectable errors.\n\nChecks are made to verify that each entry has:\n\n•   the correct number of fields\n\n•   a unique and valid group name\n\n•   a valid group identifier (/etc/group only)\n\n•   a valid list of members and administrators\n\n•   a corresponding entry in the /etc/gshadow file (respectively /etc/group for the gshadow\nchecks)\n\nThe checks for correct number of fields and unique group name are fatal. If an entry has the\nwrong number of fields, the user will be prompted to delete the entire line. If the user does\nnot answer affirmatively, all further checks are bypassed. An entry with a duplicated group\nname is prompted for deletion, but the remaining checks will still be made. All other errors\nare warnings and the user is encouraged to run the groupmod command to correct the error.\n\nThe commands which operate on the /etc/group and /etc/gshadow files are not able to alter\ncorrupted or duplicated entries.  grpck should be used in those circumstances to remove the\noffending entries.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The -r and -s options cannot be combined.\n\nThe options which apply to the grpck command are:\n",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "Display help message and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-r --read-only",
                    "content": "Execute the grpck command in read-only mode. This causes all questions regarding changes\nto be answered no without user intervention.\n",
                    "flag": "-r",
                    "long": "--read-only"
                },
                {
                    "name": "-R --root",
                    "content": "Apply changes in the CHROOTDIR directory and use the configuration files from the\nCHROOTDIR directory.\n",
                    "flag": "-R",
                    "long": "--root"
                },
                {
                    "name": "-s --sort",
                    "content": "Sort entries in /etc/group and /etc/gshadow by GID.\n\nBy default, grpck operates on /etc/group and /etc/gshadow. The user may select alternate\nfiles with the group and shadow parameters.\n",
                    "flag": "-s",
                    "long": "--sort"
                }
            ]
        },
        "CONFIGURATION": {
            "content": "The following configuration variables in /etc/login.defs change the behavior of this tool:\n",
            "subsections": [
                {
                    "name": "MAX___MEMBERS___PER___GROUP (number)",
                    "content": "Maximum members per group entry. When the maximum is reached, a new group entry (line) is\nstarted in /etc/group (with the same name, same password, and same GID).\n\nThe default value is 0, meaning that there are no limits in the number of members in a\ngroup.\n\nThis feature (split group) permits to limit the length of lines in the group file. This\nis useful to make sure that lines for NIS groups are not larger than 1024 characters.\n\nIf you need to enforce such limit, you can use 25.\n\nNote: split groups may not be supported by all tools (even in the Shadow toolsuite). You\nshould not use this variable unless you really need it.\n"
                }
            ]
        },
        "FILES": {
            "content": "/etc/group\nGroup account information.\n\n/etc/gshadow\nSecure group account information.\n\n/etc/passwd\nUser account information.\n",
            "subsections": []
        },
        "EXIT VALUES": {
            "content": "The grpck command exits with the following values:\n\n0\nsuccess\n\n1\ninvalid command syntax\n\n2\none or more bad group entries\n\n3\ncan't open group files\n\n4\ncan't lock group files\n\n5\ncan't update group files\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "group(5), groupmod(8), gshadow(5), passwd(5), pwck(8), shadow(5).\n\n\n\nshadow-utils 4.8.1                           02/06/2024                                     GRPCK(8)",
            "subsections": []
        }
    },
    "summary": "grpck - verify integrity of group files",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help message and exit."
        },
        {
            "flag": "-r",
            "long": "--read-only",
            "arg": null,
            "description": "Execute the grpck command in read-only mode. This causes all questions regarding changes to be answered no without user intervention."
        },
        {
            "flag": "-R",
            "long": "--root",
            "arg": null,
            "description": "Apply changes in the CHROOTDIR directory and use the configuration files from the CHROOTDIR directory."
        },
        {
            "flag": "-s",
            "long": "--sort",
            "arg": null,
            "description": "Sort entries in /etc/group and /etc/gshadow by GID. By default, grpck operates on /etc/group and /etc/gshadow. The user may select alternate files with the group and shadow parameters."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "group",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/group/5/json"
        },
        {
            "name": "groupmod",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/groupmod/8/json"
        },
        {
            "name": "gshadow",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/gshadow/5/json"
        },
        {
            "name": "passwd",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/passwd/5/json"
        },
        {
            "name": "pwck",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/pwck/8/json"
        },
        {
            "name": "shadow",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/shadow/5/json"
        }
    ]
}