GROUPDEL(8)

๐Ÿ’… GROUPDEL ๐Ÿ’…

okay bestie, welcome to the groupdel page from the System Management Commands girlies โœจ this is a groupdel(8) situation, iykyk ๐ŸŽ€


โœจ NAME โœจ

groupdel โ€” delete a group ๐Ÿ—‘๏ธโœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

groupdel [options] GROUP

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea ๐Ÿ“ โ€” groupdel goes in and modifies the system account files, deleting all the entries that refer to GROUP. every single one. no crumbs left ๐Ÿ’€

and like, the group you name has to actually exist first, bestie. you can't delete something that isn't there, that's not how any of this works ๐Ÿ™ˆ


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

these are the options that apply to groupdel, periodt:

  • -f, --force โ€” this one forces the removal of the group, even if there's some user out here having that group as their primary one ๐Ÿ˜ณ it's giving "i said what i said"
  • -h, --help โ€” shows you the help message and dips out ๐Ÿซถ
  • -R, --root CHROOT_DIR โ€” applies changes in the CHROOT_DIR directory and uses the configuration files from the CHROOT_DIR directory. โš ๏ธ only absolute paths are supported. and no SELINUX support, ngl
  • -P, --prefix PREFIX_DIR โ€” applies changes in the PREFIX_DIR directory and uses the configuration files from the PREFIX_DIR directory. this one does not chroot and it's intended for preparing a cross-compilation target ๐Ÿงš some limitations tho: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. and yeah, no SELINUX support either ๐Ÿ’€

๐Ÿ˜ญ CAVEATS ๐Ÿ˜ญ

listen. listen. you may not remove the primary group of any existing user. like, at all. you have to remove the user before you remove the group. that's the order. the vibe check has been failed otherwise โœ‹

and you should manually check all file systems to make sure no files remain owned by this group. yes, manually. i know. it's giving tedious but it's giving necessary ๐Ÿซก


๐ŸŽ€ CONFIGURATION ๐ŸŽ€

these configuration variables in /etc/login.defs change how this tool behaves, bestie:

๐ŸŒˆ MAX_MEMBERS_PER_GROUP (number)

maximum members per group entry. when the maximum is reached, a new group entry (a whole new line, iconic) is started in /etc/group โ€” with the same name, same password, and same GID ๐Ÿ‘‘

the default value is 0, meaning there are no limits in the number of members in a group. free range. no cap ๐Ÿ„

this feature (the split group thing) lets you limit the length of lines in the group file. it's useful to make sure that lines for NIS groups are not larger than 1024 characters ๐Ÿ“

if you need to enforce such a limit, you can use 25.

note: split groups may not be supported by all tools (even in the Shadow toolsuite). you should not use this variable unless you really, truly, fr fr need it ๐Ÿ™ˆ

๐Ÿ“ FILES ๐Ÿ“

  • /etc/group โ€” group account information ๐Ÿ“
  • /etc/gshadow โ€” secure group account information ๐Ÿ”

โญ EXIT VALUES โญ

groupdel exits with these values, and each one is telling you something:

  1. 0 โ€” success ๐ŸŽ‰ slay
  2. 2 โ€” invalid command syntax ๐Ÿ˜ฌ
  3. 6 โ€” specified group doesn't exist ๐Ÿ‘ป
  4. 8 โ€” can't remove user's primary group ๐Ÿšซ
  5. 10 โ€” can't update group file ๐Ÿ’€

๐Ÿซถ SEE ALSO ๐Ÿซถ

chfn(1), chsh(1), passwd(1), gpasswd(8), groupadd(8), groupmod(8), useradd(8), userdel(8), usermod(8).

go read those too, they're all in the same friend group bestie ๐ŸŒธ


and that's the whole page!! this one's from shadow-utils 4.20.0, dated 07/30/2026 ๐Ÿ’– thanks for coming to my ted talk, now go delete a group (responsibly, and after you've checked those file systems) ๐Ÿ‘‘โœจ๐Ÿ’…

๐Ÿ“ฆ where this page comes from