← 返回命令列表

Linux command

groupdel 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Delete

sudo groupdel [group_name]

说明

groupdel removes a group entry from the system. It modifies /etc/group and /etc/gshadow. The named group must exist. You may not remove the primary group of any existing user; the user must be removed first. Files owned by the deleted group retain their numeric GID but lose the group name association. You should manually check all file systems to ensure no files remain owned by the deleted group.

参数

-f, --force
Force removal of the group, even if a user has it as their primary group
-h, --help
Display help message and exit
-R, --root _CHROOT_DIR_
Apply changes in the CHROOT_DIR directory and use its configuration files. Only absolute paths are supported
-P, --prefix _PREFIX_DIR_
Apply changes in the PREFIX_DIR directory. Does not chroot; intended for preparing a cross-compilation target

FAQ

What is the groupdel command used for?

groupdel removes a group entry from the system. It modifies /etc/group and /etc/gshadow. The named group must exist. You may not remove the primary group of any existing user; the user must be removed first. Files owned by the deleted group retain their numeric GID but lose the group name association. You should manually check all file systems to ensure no files remain owned by the deleted group.

How do I run a basic groupdel example?

Run `sudo groupdel [group_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --force do in groupdel?

Force removal of the group, even if a user has it as their primary group