Home

groupdel

Groupdel is a command used on Unix-like operating systems to remove a named group from the system. It is part of the standard set of user and group management tools and is typically executed by a system administrator or with elevated privileges.

How groupdel works: The command updates the system’s group databases, commonly /etc/group and, where present, /etc/gshadow.

Usage and constraints: The command requires root privileges. The basic syntax is groupdel GROUP. On many systems,

Considerations: Deleting a group frees its GID for reuse and removes the group from /etc/group and /etc/gshadow.

Example: groupdel engineers

It
removes
the
group’s
entry
and
disassociates
the
group
from
any
users’
supplementary
memberships.
The
operation
does
not
delete
user
accounts
themselves,
but
it
does
remove
the
group
from
users’
listed
groups.
groupdel
will
refuse
to
delete
a
group
that
is
the
primary
group
for
one
or
more
users;
in
such
cases
you
must
first
assign
those
users
to
another
primary
group
(for
example
with
usermod
-g
NEWGROUP
USER)
or
edit
/etc/passwd
directly,
and
then
run
groupdel
again.
If
the
named
group
does
not
exist,
behavior
can
vary
by
implementation
(some
report
an
error,
others
may
suppress
the
error
or
accept
a
force
option
on
some
platforms).
It
is
a
safe
operation
for
removing
unused
or
obsolete
groups,
but
administrators
should
verify
that
no
essential
roles
depend
on
the
group
and
that
user
accounts
will
not
be
left
with
an
invalid
primary
group.