Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the groupdel command to add or delete groups in Linux

Shulou Source: shulou.com Published: 2022-06-01 17:02:18 10月04日 Update

This article introduces how to use the groupdel command to add or delete groups in Linux, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

Groupadd

Specify the group name to create a new group account, and you can get new group values from the system if needed.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Groupadd [options] group

2. List of options

Option

Description

-- help

Show help documentation

-- version

Show command version

-g gid

Specify group id

-r

Create a system group

-f

Add an existing group account and the system will get an error message and end the groupadd. If this is the case, the group will not be added (if this is the case, the system will not add it again), but also the-g option can be added at the same time. When you add a gid, the gid does not have to be the only value, but without the-o parameter, the result will be displayed after the group is built.

3. Files

/ etc/group, group information.

/ etc/gshadow, group encrypted messages.

4. Examples

Create a group and specify the id of the group

[root@localhost david] # groupadd group01-g 999 / / create a group and specify id

[root@localhost david] # tail-n 2 / etc/group / / View group information

User01:x:502:

Group01:x:999:

Groupdel

Delete the group. If there is a user in the lease, you must delete the user first.

The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.

1. Grammar

Groupdel group

2. List of options

Option

Description

-- help

Show help documentation

-- version

Show command version

3. Examples

Delete a group

[root@localhost david] # groupdel group01 / / Delete a group

[root@localhost david] # tail-n 2 / etc/group / / View group information, deleted

Webalizer:x:67:

User01:x:502:

On how to use the groupdel command in Linux to add or delete groups is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Command information system help content instance situation document more version user scope syntax scope yes no no interest parameter name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MySQL Microsoft Redmi Shulou Information