Linux Foundation Certified System Administrator Exam - Add Empty Group Command

How to Add an Empty Group to the System

Question

SIMULATION -

Which command is used to add an empty group to the system? (Specify ONLY the command without any path or parameters.)

Explanations

groupadd -or- /usr/sbin/groupadd

The command used to add an empty group to the system is groupadd.

The groupadd command is used to create a new group or to update an existing group. By default, the group will have no members, making it an empty group.

To add an empty group to the system, simply run the following command as root or with sudo privileges:

groupadd groupname

Replace groupname with the name of the group that you want to create. Once the command is run, the new group will be added to the system and can be viewed by running the cat /etc/group command or using the getent command as follows:

csharp
getent group groupname

This will display the details of the newly created group, including its group ID (GID) and any members if they exist.