Linux Groupadd-groupdel (add a group and delete a user group)

Source: Internet
Author: User

Command: Groupadd

Syntax: groupadd [-G GID] groupname

[Email protected] ~]# groupadd grptest1[[email protected] ~]# tail-n1/etc/groupgrptest1:x:502:

The "-g" option does not create groups according to the system default GID, which is the same as the user, with GID starting from 500.

[Email protected] ~]# groupadd-g 511 grptest2[[email protected] ~]# tail-n2/etc/groupgrptest1:x:502:grptest2:x:511:

The "-G" option allows you to customize the GID.

    1. Delete a group

Command: Groupdel

[Email protected] ~]# Groupdel grptest2[[email protected] ~]# tail-n3/etc/grouptestgroup:x:500:user1:x:501:grptest1: x:502:

There are no special options for this command, but there is one case where you cannot delete a group:

[Email protected] ~]# Groupdel User1groupdel:cannot Remove the primary group of user ' User1 '

This is because the User1 account is included in the User1 group and can only be deleted if the User1 account is deleted.


This article is from "Linux rookie" blog, please be sure to keep this source http://490617581.blog.51cto.com/11186315/1757785

Linux Groupadd-groupdel (add a group and delete a user group)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.